@transfergratis/react-native-sdk 0.1.4 → 0.1.6

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 (216) hide show
  1. package/build/api/axios.d.ts +30 -0
  2. package/build/api/axios.d.ts.map +1 -0
  3. package/build/api/axios.js +92 -0
  4. package/build/api/axios.js.map +1 -0
  5. package/build/components/EnhancedCameraView.d.ts +1 -41
  6. package/build/components/EnhancedCameraView.d.ts.map +1 -1
  7. package/build/components/EnhancedCameraView.js +75 -34
  8. package/build/components/EnhancedCameraView.js.map +1 -1
  9. package/build/components/EnhancedCameraView.web.d.ts +1 -41
  10. package/build/components/EnhancedCameraView.web.d.ts.map +1 -1
  11. package/build/components/EnhancedCameraView.web.js +28 -4
  12. package/build/components/EnhancedCameraView.web.js.map +1 -1
  13. package/build/components/KYCElements/CountrySelectionTemplate.d.ts +2 -2
  14. package/build/components/KYCElements/CountrySelectionTemplate.d.ts.map +1 -1
  15. package/build/components/KYCElements/CountrySelectionTemplate.js +77 -114
  16. package/build/components/KYCElements/CountrySelectionTemplate.js.map +1 -1
  17. package/build/components/KYCElements/FileUploadTemplate.d.ts.map +1 -1
  18. package/build/components/KYCElements/FileUploadTemplate.js +7 -3
  19. package/build/components/KYCElements/FileUploadTemplate.js.map +1 -1
  20. package/build/components/KYCElements/IDCardCapture.d.ts +7 -2
  21. package/build/components/KYCElements/IDCardCapture.d.ts.map +1 -1
  22. package/build/components/KYCElements/IDCardCapture.js +253 -104
  23. package/build/components/KYCElements/IDCardCapture.js.map +1 -1
  24. package/build/components/KYCElements/InitializationStep.d.ts +5 -0
  25. package/build/components/KYCElements/InitializationStep.d.ts.map +1 -0
  26. package/build/components/KYCElements/InitializationStep.js +41 -0
  27. package/build/components/KYCElements/InitializationStep.js.map +1 -0
  28. package/build/components/KYCElements/LocationCaptureTemplate.d.ts.map +1 -1
  29. package/build/components/KYCElements/LocationCaptureTemplate.js +15 -13
  30. package/build/components/KYCElements/LocationCaptureTemplate.js.map +1 -1
  31. package/build/components/KYCElements/OrientationVideoCapture.d.ts +2 -2
  32. package/build/components/KYCElements/OrientationVideoCapture.d.ts.map +1 -1
  33. package/build/components/KYCElements/OrientationVideoCapture.js.map +1 -1
  34. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts +2 -2
  35. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts.map +1 -1
  36. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.js.map +1 -1
  37. package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts +2 -2
  38. package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts.map +1 -1
  39. package/build/components/KYCElements/OrientationVideoCaptureFinal.js.map +1 -1
  40. package/build/components/KYCElements/ReviewSubmitTemplate.d.ts +12 -0
  41. package/build/components/KYCElements/ReviewSubmitTemplate.d.ts.map +1 -0
  42. package/build/components/KYCElements/ReviewSubmitTemplate.js +171 -0
  43. package/build/components/KYCElements/ReviewSubmitTemplate.js.map +1 -0
  44. package/build/components/KYCElements/SelfieCaptureTemplate.d.ts +6 -2
  45. package/build/components/KYCElements/SelfieCaptureTemplate.d.ts.map +1 -1
  46. package/build/components/KYCElements/SelfieCaptureTemplate.js +137 -38
  47. package/build/components/KYCElements/SelfieCaptureTemplate.js.map +1 -1
  48. package/build/components/KYCElements/VerificationProgressTemplate.d.ts +12 -0
  49. package/build/components/KYCElements/VerificationProgressTemplate.d.ts.map +1 -0
  50. package/build/components/KYCElements/VerificationProgressTemplate.js +194 -0
  51. package/build/components/KYCElements/VerificationProgressTemplate.js.map +1 -0
  52. package/build/components/OverLay/IdCard.d.ts +1 -1
  53. package/build/components/OverLay/IdCard.d.ts.map +1 -1
  54. package/build/components/OverLay/IdCard.js +10 -6
  55. package/build/components/OverLay/IdCard.js.map +1 -1
  56. package/build/components/OverLay/SelfieOverlay.d.ts +1 -1
  57. package/build/components/OverLay/SelfieOverlay.d.ts.map +1 -1
  58. package/build/components/OverLay/SelfieOverlay.js +5 -4
  59. package/build/components/OverLay/SelfieOverlay.js.map +1 -1
  60. package/build/components/OverLay/type.d.ts +71 -1
  61. package/build/components/OverLay/type.d.ts.map +1 -1
  62. package/build/components/OverLay/type.js.map +1 -1
  63. package/build/components/TemplateKYCExample.d.ts +4 -1
  64. package/build/components/TemplateKYCExample.d.ts.map +1 -1
  65. package/build/components/TemplateKYCExample.js +74 -199
  66. package/build/components/TemplateKYCExample.js.map +1 -1
  67. package/build/components/TemplateKYCFlowRefactored.d.ts +3 -2
  68. package/build/components/TemplateKYCFlowRefactored.d.ts.map +1 -1
  69. package/build/components/TemplateKYCFlowRefactored.js +64 -40
  70. package/build/components/TemplateKYCFlowRefactored.js.map +1 -1
  71. package/build/components/example/OrientationVideoExample.d.ts.map +1 -1
  72. package/build/components/example/OrientationVideoExample.js +1 -5
  73. package/build/components/example/OrientationVideoExample.js.map +1 -1
  74. package/build/config/countriesData.d.ts +3 -0
  75. package/build/config/countriesData.d.ts.map +1 -0
  76. package/build/config/countriesData.js +79 -0
  77. package/build/config/countriesData.js.map +1 -0
  78. package/build/config/region_mapping.d.ts +3 -0
  79. package/build/config/region_mapping.d.ts.map +1 -0
  80. package/build/config/region_mapping.js +687 -0
  81. package/build/config/region_mapping.js.map +1 -0
  82. package/build/hooks/useI18n.d.ts +11 -0
  83. package/build/hooks/useI18n.d.ts.map +1 -0
  84. package/build/hooks/useI18n.js +37 -0
  85. package/build/hooks/useI18n.js.map +1 -0
  86. package/build/hooks/useOrientationVideo.d.ts +1 -2
  87. package/build/hooks/useOrientationVideo.d.ts.map +1 -1
  88. package/build/hooks/useOrientationVideo.js +2 -1
  89. package/build/hooks/useOrientationVideo.js.map +1 -1
  90. package/build/hooks/useRealtimeVerifier.d.ts +28 -0
  91. package/build/hooks/useRealtimeVerifier.d.ts.map +1 -0
  92. package/build/hooks/useRealtimeVerifier.js +91 -0
  93. package/build/hooks/useRealtimeVerifier.js.map +1 -0
  94. package/build/hooks/useTemplateKYCFlow.d.ts +6 -3
  95. package/build/hooks/useTemplateKYCFlow.d.ts.map +1 -1
  96. package/build/hooks/useTemplateKYCFlow.js +356 -42
  97. package/build/hooks/useTemplateKYCFlow.js.map +1 -1
  98. package/build/i18n/en/index.d.ts +168 -0
  99. package/build/i18n/en/index.d.ts.map +1 -0
  100. package/build/i18n/en/index.js +195 -0
  101. package/build/i18n/en/index.js.map +1 -0
  102. package/build/i18n/fr/index.d.ts +168 -0
  103. package/build/i18n/fr/index.d.ts.map +1 -0
  104. package/build/i18n/fr/index.js +194 -0
  105. package/build/i18n/fr/index.js.map +1 -0
  106. package/build/i18n/index.d.ts +10 -0
  107. package/build/i18n/index.d.ts.map +1 -0
  108. package/build/i18n/index.js +56 -0
  109. package/build/i18n/index.js.map +1 -0
  110. package/build/i18n/types.d.ts +153 -0
  111. package/build/i18n/types.d.ts.map +1 -0
  112. package/build/i18n/types.js +3 -0
  113. package/build/i18n/types.js.map +1 -0
  114. package/build/i18n/usage-example.d.ts +4 -0
  115. package/build/i18n/usage-example.d.ts.map +1 -0
  116. package/build/i18n/usage-example.js +189 -0
  117. package/build/i18n/usage-example.js.map +1 -0
  118. package/build/index.d.ts +1 -0
  119. package/build/index.d.ts.map +1 -1
  120. package/build/index.js +2 -0
  121. package/build/index.js.map +1 -1
  122. package/build/modules/api/CardAuthentification.d.ts +22 -0
  123. package/build/modules/api/CardAuthentification.d.ts.map +1 -0
  124. package/build/modules/api/CardAuthentification.js +107 -0
  125. package/build/modules/api/CardAuthentification.js.map +1 -0
  126. package/build/modules/api/KYCService.d.ts +58 -1
  127. package/build/modules/api/KYCService.d.ts.map +1 -1
  128. package/build/modules/api/KYCService.js +304 -27
  129. package/build/modules/api/KYCService.js.map +1 -1
  130. package/build/modules/api/SelfieVerification.d.ts +3 -0
  131. package/build/modules/api/SelfieVerification.d.ts.map +1 -0
  132. package/build/modules/api/SelfieVerification.js +9 -0
  133. package/build/modules/api/SelfieVerification.js.map +1 -0
  134. package/build/modules/api/backendApi.d.ts +2 -0
  135. package/build/modules/api/backendApi.d.ts.map +1 -0
  136. package/build/modules/api/backendApi.js +6 -0
  137. package/build/modules/api/backendApi.js.map +1 -0
  138. package/build/modules/api/types.d.ts +45 -0
  139. package/build/modules/api/types.d.ts.map +1 -0
  140. package/build/modules/api/types.js +2 -0
  141. package/build/modules/api/types.js.map +1 -0
  142. package/build/types/KYC.types.d.ts +56 -7
  143. package/build/types/KYC.types.d.ts.map +1 -1
  144. package/build/types/KYC.types.js +9 -1
  145. package/build/types/KYC.types.js.map +1 -1
  146. package/build/utils/cropByObb.d.ts +11 -0
  147. package/build/utils/cropByObb.d.ts.map +1 -0
  148. package/build/utils/cropByObb.js +78 -0
  149. package/build/utils/cropByObb.js.map +1 -0
  150. package/build/utils/get-document-type-info.d.ts +13 -0
  151. package/build/utils/get-document-type-info.d.ts.map +1 -0
  152. package/build/utils/get-document-type-info.js +59 -0
  153. package/build/utils/get-document-type-info.js.map +1 -0
  154. package/build/utils/pathToBase64.d.ts +3 -0
  155. package/build/utils/pathToBase64.d.ts.map +1 -0
  156. package/build/utils/pathToBase64.js +47 -0
  157. package/build/utils/pathToBase64.js.map +1 -0
  158. package/build/utils/remove-duplicate.d.ts +2 -0
  159. package/build/utils/remove-duplicate.d.ts.map +1 -0
  160. package/build/utils/remove-duplicate.js +4 -0
  161. package/build/utils/remove-duplicate.js.map +1 -0
  162. package/build/web/WebKYCEntry.d.ts +9 -0
  163. package/build/web/WebKYCEntry.d.ts.map +1 -0
  164. package/build/web/WebKYCEntry.js +156 -0
  165. package/build/web/WebKYCEntry.js.map +1 -0
  166. package/build/web/index.d.ts +2 -0
  167. package/build/web/index.d.ts.map +1 -0
  168. package/build/web/index.js +2 -0
  169. package/build/web/index.js.map +1 -0
  170. package/package.json +3 -1
  171. package/src/api/axios.ts +144 -0
  172. package/src/components/EnhancedCameraView.tsx +96 -78
  173. package/src/components/EnhancedCameraView.web.tsx +41 -40
  174. package/src/components/KYCElements/CountrySelectionTemplate.tsx +111 -136
  175. package/src/components/KYCElements/FileUploadTemplate.tsx +14 -8
  176. package/src/components/KYCElements/IDCardCapture.tsx +311 -115
  177. package/src/components/KYCElements/InitializationStep.tsx +53 -0
  178. package/src/components/KYCElements/LocationCaptureTemplate.tsx +17 -15
  179. package/src/components/KYCElements/OrientationVideoCapture.tsx +2 -2
  180. package/src/components/KYCElements/OrientationVideoCaptureEnhanced.tsx +2 -2
  181. package/src/components/KYCElements/OrientationVideoCaptureFinal.tsx +2 -2
  182. package/src/components/KYCElements/ReviewSubmitTemplate.tsx +201 -0
  183. package/src/components/KYCElements/SelfieCaptureTemplate.tsx +174 -57
  184. package/src/components/KYCElements/VerificationProgressTemplate.tsx +246 -0
  185. package/src/components/OverLay/IdCard.tsx +17 -9
  186. package/src/components/OverLay/SelfieOverlay.tsx +6 -5
  187. package/src/components/OverLay/type.ts +64 -2
  188. package/src/components/TemplateKYCExample.tsx +80 -200
  189. package/src/components/TemplateKYCFlowRefactored.tsx +80 -48
  190. package/src/components/example/OrientationVideoExample.tsx +3 -7
  191. package/src/config/countriesData.ts +84 -0
  192. package/src/config/region_mapping.ts +688 -0
  193. package/src/hooks/useI18n.ts +53 -0
  194. package/src/hooks/useOrientationVideo.ts +2 -2
  195. package/src/hooks/useRealtimeVerifier.ts +128 -0
  196. package/src/hooks/useTemplateKYCFlow.tsx +407 -57
  197. package/src/i18n/README.md +288 -0
  198. package/src/i18n/en/index.ts +206 -0
  199. package/src/i18n/fr/index.ts +205 -0
  200. package/src/i18n/index.ts +65 -0
  201. package/src/i18n/types.ts +172 -0
  202. package/src/i18n/usage-example.tsx +202 -0
  203. package/src/index.ts +3 -0
  204. package/src/modules/api/CardAuthentification.ts +114 -0
  205. package/src/modules/api/KYCService.ts +350 -30
  206. package/src/modules/api/SelfieVerification.ts +11 -0
  207. package/src/modules/api/backendApi.ts +8 -0
  208. package/src/modules/api/types.ts +51 -0
  209. package/src/types/KYC.types.ts +82 -14
  210. package/src/utils/cropByObb.ts +99 -0
  211. package/src/utils/get-document-type-info.ts +62 -0
  212. package/src/utils/pathToBase64.ts +47 -0
  213. package/src/utils/remove-duplicate.ts +3 -0
  214. package/src/web/WebKYCEntry.tsx +215 -0
  215. package/src/web/index.ts +1 -0
  216. package/src/types/nativewind.d.ts +0 -2
@@ -0,0 +1,171 @@
1
+ import React, { useMemo } from 'react';
2
+ import { View, Text, StyleSheet, TouchableOpacity, ScrollView } from 'react-native';
3
+ import { useTemplateKYCFlowContext } from '../../hooks/useTemplateKYCFlow';
4
+ import { useI18n } from '../../hooks/useI18n';
5
+ export const ReviewSubmitTemplate = () => {
6
+ const { t } = useI18n();
7
+ const { state, actions, getLocalizedText } = useTemplateKYCFlowContext();
8
+ const idSection = useMemo(() => {
9
+ const idComp = state.template.components.find(c => c.type === 'id_card');
10
+ return idComp ? state.componentData[idComp.id] : null;
11
+ }, [state.template.components, state.componentData]);
12
+ // Helper to coerce possibly-nested localized configs into the expected shape
13
+ const coerceLocalized = (value, fallback) => {
14
+ if (value && typeof value === 'object') {
15
+ if (typeof value.en === 'string' || typeof value.fr === 'string') {
16
+ return {
17
+ en: typeof value.en === 'string' ? value.en : fallback.en,
18
+ fr: typeof value.fr === 'string' ? value.fr : fallback.fr,
19
+ ...value,
20
+ };
21
+ }
22
+ }
23
+ return fallback;
24
+ };
25
+ // const reviewComp = useMemo(() => {
26
+ // return state.template.components.find(c => c.type === 'review_submit');
27
+ // }, [state.template.components]);
28
+ const dynamicComponents = useMemo(() => {
29
+ return state.template.components.filter(c => c.type !== 'review_submit' && c.type !== 'verification_progress');
30
+ }, [state.template.components]);
31
+ const handleSubmit = async () => {
32
+ await actions.nextComponent();
33
+ };
34
+ return (<View style={styles.container}>
35
+ <Text style={styles.title}>{t('kyc.reviewSubmit.title')}</Text>
36
+ <Text style={styles.subtitle}>{t('kyc.reviewSubmit.subtitle')}</Text>
37
+
38
+ <ScrollView contentContainerStyle={styles.scrollContent}>
39
+ {dynamicComponents.map((comp) => {
40
+ const compData = state.componentData[comp.id] || {};
41
+ const isCompleted = state.completedComponents.includes(comp.id);
42
+ if (comp.type === 'id_card') {
43
+ const hasFront = !!(compData.front || compData.front_base64 || compData.front_mrz);
44
+ const hasBack = !!(compData.back || compData.back_base64 || compData.back_mrz);
45
+ return (<View key={comp.id} style={styles.section}>
46
+ <Text style={styles.sectionTitle}>{t('kyc.reviewSubmit.documentInfo')}</Text>
47
+ <View style={styles.row}>
48
+ <View style={[styles.tile, hasFront ? styles.active : null]}>
49
+ <Text style={styles.tileLabel}>{t('kyc.idCardCapture.frontSide')}</Text>
50
+ {hasFront ? <Text style={styles.check}>✓</Text> : null}
51
+ </View>
52
+ <View style={[styles.tile, hasBack ? styles.active : null]}>
53
+ <Text style={styles.tileLabel}>{t('kyc.idCardCapture.backSide')}</Text>
54
+ {hasBack ? <Text style={styles.check}>✓</Text> : null}
55
+ </View>
56
+ </View>
57
+ {idSection?.documentType ? (<Text style={styles.caption}>{idSection.documentType}</Text>) : null}
58
+ </View>);
59
+ }
60
+ if (comp.type === 'selfie') {
61
+ const orientations = (comp.config?.orientations || ['center', 'right', 'left']);
62
+ return (<View key={comp.id} style={styles.section}>
63
+ <Text style={styles.sectionTitle}>{t('kyc.selfieCapture.title')}</Text>
64
+ <View style={styles.row}>
65
+ {orientations.map((o) => {
66
+ const has = !!compData[o];
67
+ const colorStyle = o === 'center' ? styles.pink : o === 'right' ? styles.blue : styles.purple;
68
+ return (<View key={o} style={[styles.tile, colorStyle, has ? styles.active : null]}>
69
+ <Text style={styles.tileLabel}>{o.charAt(0).toUpperCase() + o.slice(1)}</Text>
70
+ {has ? <Text style={styles.check}>✓</Text> : null}
71
+ </View>);
72
+ })}
73
+ </View>
74
+ <Text style={styles.caption}>{t('kyc.selfieCapture.success')}</Text>
75
+ </View>);
76
+ }
77
+ // Generic fallback for other component types
78
+ return (<View key={comp.id} style={styles.section}>
79
+ <Text style={styles.sectionTitle}>{getLocalizedText(coerceLocalized(comp.labels, { en: comp.type, fr: comp.type }))}</Text>
80
+ <Text style={styles.caption}>{isCompleted ? t('common.success') : t('kyc.verificationProgress.status.pending')}</Text>
81
+ </View>);
82
+ })}
83
+ </ScrollView>
84
+
85
+ <TouchableOpacity style={[styles.button, styles.primary]} onPress={handleSubmit}>
86
+ <Text style={styles.buttonText}>{t('kyc.reviewSubmit.submitButton')}</Text>
87
+ </TouchableOpacity>
88
+ </View>);
89
+ };
90
+ const styles = StyleSheet.create({
91
+ container: {
92
+ flex: 1,
93
+ width: '100%',
94
+ paddingHorizontal: 16,
95
+ paddingVertical: 12,
96
+ },
97
+ title: {
98
+ fontSize: 24,
99
+ fontWeight: 'bold',
100
+ color: '#111827',
101
+ marginBottom: 4,
102
+ },
103
+ subtitle: {
104
+ fontSize: 14,
105
+ color: '#6B7280',
106
+ marginBottom: 16,
107
+ },
108
+ section: {
109
+ backgroundColor: 'white',
110
+ borderRadius: 16,
111
+ padding: 16,
112
+ marginBottom: 16,
113
+ },
114
+ sectionTitle: {
115
+ fontSize: 18,
116
+ fontWeight: '700',
117
+ color: '#111827',
118
+ marginBottom: 12,
119
+ },
120
+ scrollContent: {
121
+ paddingBottom: 24,
122
+ },
123
+ row: {
124
+ flexDirection: 'row',
125
+ gap: 12,
126
+ },
127
+ tile: {
128
+ flex: 1,
129
+ height: 110,
130
+ borderRadius: 16,
131
+ backgroundColor: '#F3F4F6',
132
+ alignItems: 'center',
133
+ justifyContent: 'center',
134
+ },
135
+ tileLabel: {
136
+ fontSize: 14,
137
+ color: '#111827',
138
+ marginBottom: 8,
139
+ },
140
+ check: {
141
+ fontSize: 18,
142
+ color: '#10B981',
143
+ fontWeight: '700',
144
+ },
145
+ active: {
146
+ backgroundColor: '#DDE9FF',
147
+ },
148
+ pink: { backgroundColor: '#FDE2E7' },
149
+ blue: { backgroundColor: '#DDE9FF' },
150
+ purple: { backgroundColor: '#EDE2FF' },
151
+ caption: {
152
+ marginTop: 10,
153
+ fontSize: 12,
154
+ color: '#6B7280',
155
+ },
156
+ button: {
157
+ paddingVertical: 14,
158
+ borderRadius: 10,
159
+ alignItems: 'center',
160
+ marginTop: 12,
161
+ },
162
+ primary: {
163
+ backgroundColor: '#2DBD60',
164
+ },
165
+ buttonText: {
166
+ color: 'white',
167
+ fontSize: 16,
168
+ fontWeight: '600',
169
+ },
170
+ });
171
+ //# sourceMappingURL=ReviewSubmitTemplate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReviewSubmitTemplate.js","sourceRoot":"","sources":["../../../src/components/KYCElements/ReviewSubmitTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEpF,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAU9C,MAAM,CAAC,MAAM,oBAAoB,GAAwC,GAAG,EAAE;IAC5E,MAAM,EAAE,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC;IACxB,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,GAAG,yBAAyB,EAAE,CAAC;IAEzE,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE;QAC7B,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;QACzE,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACxD,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;IAErD,6EAA6E;IAC7E,MAAM,eAAe,GAAG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;KAC3B;IACD,IAAI,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE;IACpC,IAAI,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE;IACpC,MAAM,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE;IACtC,OAAO,EAAE;QACP,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,SAAS;KACjB;IACD,MAAM,EAAE;QACN,eAAe,EAAE,EAAE;QACnB,YAAY,EAAE,EAAE;QAChB,UAAU,EAAE,QAAQ;QACpB,SAAS,EAAE,EAAE;KACd;IACD,OAAO,EAAE;QACP,eAAe,EAAE,SAAS;KAC3B;IACD,UAAU,EAAE;QACV,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;KAClB;CACF,CAAC,CAAC","sourcesContent":["import React, { useMemo } from 'react';\nimport { View, Text, StyleSheet, TouchableOpacity, ScrollView } from 'react-native';\nimport { TemplateComponent } from '../../types/KYC.types';\nimport { useTemplateKYCFlowContext } from '../../hooks/useTemplateKYCFlow';\nimport { useI18n } from '../../hooks/useI18n';\n\ninterface ReviewSubmitTemplateProps {\n component: TemplateComponent;\n value: unknown;\n onValueChange: (data: unknown) => void;\n error?: string;\n language?: string;\n}\n\nexport const ReviewSubmitTemplate: React.FC<ReviewSubmitTemplateProps> = () => {\n const { t } = useI18n();\n const { state, actions, getLocalizedText } = useTemplateKYCFlowContext();\n\n const idSection = useMemo(() => {\n const idComp = state.template.components.find(c => c.type === 'id_card');\n return idComp ? state.componentData[idComp.id] : null;\n }, [state.template.components, state.componentData]);\n\n // Helper to coerce possibly-nested localized configs into the expected shape\n const coerceLocalized = (value: any, fallback: { en: string; fr: string }) => {\n if (value && typeof value === 'object') {\n if (typeof value.en === 'string' || typeof value.fr === 'string') {\n return {\n en: typeof value.en === 'string' ? value.en : fallback.en,\n fr: typeof value.fr === 'string' ? value.fr : fallback.fr,\n ...value,\n } as { [key: string]: string; en: string; fr: string };\n }\n }\n return fallback;\n };\n\n // const reviewComp = useMemo(() => {\n // return state.template.components.find(c => c.type === 'review_submit');\n // }, [state.template.components]);\n\n const dynamicComponents = useMemo(() => {\n return state.template.components.filter(c => c.type !== 'review_submit' && c.type !== 'verification_progress');\n }, [state.template.components]);\n\n const handleSubmit = async () => {\n await actions.nextComponent();\n };\n\n return (\n <View style={styles.container}>\n <Text style={styles.title}>{t('kyc.reviewSubmit.title')}</Text>\n <Text style={styles.subtitle}>{t('kyc.reviewSubmit.subtitle')}</Text>\n\n <ScrollView contentContainerStyle={styles.scrollContent}>\n {dynamicComponents.map((comp) => {\n const compData = state.componentData[comp.id] || {};\n const isCompleted = state.completedComponents.includes(comp.id);\n if (comp.type === 'id_card') {\n const hasFront = !!(compData.front || compData.front_base64 || compData.front_mrz);\n const hasBack = !!(compData.back || compData.back_base64 || compData.back_mrz);\n return (\n <View key={comp.id} style={styles.section}>\n <Text style={styles.sectionTitle}>{t('kyc.reviewSubmit.documentInfo')}</Text>\n <View style={styles.row}>\n <View style={[styles.tile, hasFront ? styles.active : null]}>\n <Text style={styles.tileLabel}>{t('kyc.idCardCapture.frontSide')}</Text>\n {hasFront ? <Text style={styles.check}>✓</Text> : null}\n </View>\n <View style={[styles.tile, hasBack ? styles.active : null]}>\n <Text style={styles.tileLabel}>{t('kyc.idCardCapture.backSide')}</Text>\n {hasBack ? <Text style={styles.check}>✓</Text> : null}\n </View>\n </View>\n {idSection?.documentType ? (\n <Text style={styles.caption}>{idSection.documentType}</Text>\n ) : null}\n </View>\n );\n }\n if (comp.type === 'selfie') {\n const orientations = ((comp.config as any)?.orientations || ['center', 'right', 'left']) as string[];\n return (\n <View key={comp.id} style={styles.section}>\n <Text style={styles.sectionTitle}>{t('kyc.selfieCapture.title')}</Text>\n <View style={styles.row}>\n {orientations.map((o) => {\n const has = !!compData[o];\n const colorStyle = o === 'center' ? styles.pink : o === 'right' ? styles.blue : styles.purple;\n return (\n <View key={o} style={[styles.tile, colorStyle, has ? styles.active : null]}>\n <Text style={styles.tileLabel}>{o.charAt(0).toUpperCase() + o.slice(1)}</Text>\n {has ? <Text style={styles.check}>✓</Text> : null}\n </View>\n );\n })}\n </View>\n <Text style={styles.caption}>{t('kyc.selfieCapture.success')}</Text>\n </View>\n );\n }\n // Generic fallback for other component types\n return (\n <View key={comp.id} style={styles.section}>\n <Text style={styles.sectionTitle}>{getLocalizedText(coerceLocalized(comp.labels, { en: comp.type, fr: comp.type }))}</Text>\n <Text style={styles.caption}>{isCompleted ? t('common.success') : t('kyc.verificationProgress.status.pending')}</Text>\n </View>\n );\n })}\n </ScrollView>\n\n <TouchableOpacity style={[styles.button, styles.primary]} onPress={handleSubmit}>\n <Text style={styles.buttonText}>{t('kyc.reviewSubmit.submitButton')}</Text>\n </TouchableOpacity>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n width: '100%',\n paddingHorizontal: 16,\n paddingVertical: 12,\n },\n title: {\n fontSize: 24,\n fontWeight: 'bold',\n color: '#111827',\n marginBottom: 4,\n },\n subtitle: {\n fontSize: 14,\n color: '#6B7280',\n marginBottom: 16,\n },\n section: {\n backgroundColor: 'white',\n borderRadius: 16,\n padding: 16,\n marginBottom: 16,\n },\n sectionTitle: {\n fontSize: 18,\n fontWeight: '700',\n color: '#111827',\n marginBottom: 12,\n },\n scrollContent: {\n paddingBottom: 24,\n },\n row: {\n flexDirection: 'row',\n gap: 12,\n },\n tile: {\n flex: 1,\n height: 110,\n borderRadius: 16,\n backgroundColor: '#F3F4F6',\n alignItems: 'center',\n justifyContent: 'center',\n },\n tileLabel: {\n fontSize: 14,\n color: '#111827',\n marginBottom: 8,\n },\n check: {\n fontSize: 18,\n color: '#10B981',\n fontWeight: '700',\n },\n active: {\n backgroundColor: '#DDE9FF',\n },\n pink: { backgroundColor: '#FDE2E7' },\n blue: { backgroundColor: '#DDE9FF' },\n purple: { backgroundColor: '#EDE2FF' },\n caption: {\n marginTop: 10,\n fontSize: 12,\n color: '#6B7280',\n },\n button: {\n paddingVertical: 14,\n borderRadius: 10,\n alignItems: 'center',\n marginTop: 12,\n },\n primary: {\n backgroundColor: '#2DBD60',\n },\n buttonText: {\n color: 'white',\n fontSize: 16,\n fontWeight: '600',\n },\n});\n\n\n"]}
@@ -1,9 +1,13 @@
1
1
  import React from 'react';
2
2
  import { TemplateComponent } from '../../types/KYC.types';
3
+ interface IImagePayload {
4
+ dir: string;
5
+ file: string;
6
+ }
3
7
  interface SelfieCaptureTemplateProps {
4
8
  component: TemplateComponent;
5
- value: Record<string, string> | undefined;
6
- onValueChange: (value: Record<string, string>) => void;
9
+ value: Record<string, IImagePayload> | undefined;
10
+ onValueChange: (value: Record<string, IImagePayload | string>) => void;
7
11
  error?: string;
8
12
  language: string;
9
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SelfieCaptureTemplate.d.ts","sourceRoot":"","sources":["../../../src/components/KYCElements/SelfieCaptureTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAA+B,MAAM,uBAAuB,CAAC;AAMvF,UAAU,0BAA0B;IAClC,SAAS,EAAE,iBAAiB,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IAC1C,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAkOtE,CAAC"}
1
+ {"version":3,"file":"SelfieCaptureTemplate.d.ts","sourceRoot":"","sources":["../../../src/components/KYCElements/SelfieCaptureTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAA8F,MAAM,uBAAuB,CAAC;AAUtJ,UAAU,aAAa;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AACD,UAAU,0BAA0B;IAClC,SAAS,EAAE,iBAAiB,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,SAAS,CAAC;IACjD,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAAC,KAAK,IAAI,CAAC;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CA+UtE,CAAC"}
@@ -1,29 +1,43 @@
1
- import React, { useEffect, useState } from 'react';
1
+ import React, { useEffect, useMemo, useState } from 'react';
2
2
  import { View, Text, StyleSheet, Alert, ScrollView } from 'react-native';
3
3
  import { EnhancedCameraView } from '../EnhancedCameraView';
4
4
  import { Button } from '../ui/Button';
5
5
  import { useTemplateKYCFlowContext } from '../../hooks/useTemplateKYCFlow';
6
+ import { useI18n } from '../../hooks/useI18n';
6
7
  import SelfieOverlay from '../OverLay/SelfieOverlay';
8
+ import selfieVerification from '../../modules/api/SelfieVerification';
9
+ import pathToBase64 from '../../utils/pathToBase64';
10
+ import { truncateFields } from '../../modules/api/KYCService';
7
11
  export const SelfieCaptureTemplate = ({ component, value, onValueChange, error, language, }) => {
12
+ const { t } = useI18n();
8
13
  const config = component.config;
9
- const maxAttempts = config.max_attempts || 3;
10
- const orientations = config.orientations || ['front'];
14
+ const orientations = (config.orientations || ['center']);
11
15
  const { actions, state, } = useTemplateKYCFlowContext();
16
+ const [silentCaptureResult, setSilentCaptureResult] = useState({ success: false, isAnalyzing: false });
12
17
  const [showCamera, setShowCamera] = useState(false);
13
18
  const [currentOrientation, setCurrentOrientation] = useState(orientations[0]);
14
19
  const [capturedImages, setCapturedImages] = useState(value || {});
15
- const [attempts, setAttempts] = useState(0);
16
20
  const getLocalizedText = (text) => {
17
- return text[language] || text.en || '';
21
+ if (!text)
22
+ return '';
23
+ // If text is a nested record (e.g., per theme/device), try to pick a default then localize
24
+ const maybeNested = text;
25
+ if (maybeNested && typeof maybeNested === 'object' && 'en' in maybeNested === false && 'fr' in maybeNested === false) {
26
+ const firstKey = Object.keys(maybeNested)[0];
27
+ const nested = maybeNested[firstKey];
28
+ return nested?.[language] || nested?.en || '';
29
+ }
30
+ const loc = text;
31
+ return loc[language] || loc.en || '';
18
32
  };
19
33
  const getOrientationInstructions = (orientation) => {
20
34
  switch (orientation) {
21
- case 'front':
22
- return 'Prenez un selfie de face, regardez droit devant vous';
35
+ case 'center':
36
+ return state.currentLanguage === "en" ? "Take a selfie of face, look straight ahead you" : "Prenez un selfie de face, regardez droit devant vous";
23
37
  case 'left':
24
- return 'Tournez votre tête vers la gauche, gardez les épaules droites';
38
+ return state.currentLanguage === "en" ? "Turn your head to the left, keep your shoulders straight" : "Tournez votre tête vers la gauche, gardez les épaules droites";
25
39
  case 'right':
26
- return 'Tournez votre tête vers la droite, gardez les épaules droites';
40
+ return state.currentLanguage === "en" ? "Turn your head to the right, keep your shoulders straight" : "Tournez votre tête vers la droite, gardez les épaules droites";
27
41
  default:
28
42
  return getLocalizedText(component.instructions);
29
43
  }
@@ -33,53 +47,120 @@ export const SelfieCaptureTemplate = ({ component, value, onValueChange, error,
33
47
  }, [showCamera]);
34
48
  const getOrientationLabel = (orientation) => {
35
49
  switch (orientation) {
36
- case 'front':
37
- return 'Selfie de face';
50
+ case 'center':
51
+ return state.currentLanguage === "en" ? "Selfie de face" : "Selfie de face";
38
52
  case 'left':
39
- return 'Selfie profil gauche';
53
+ return state.currentLanguage === "en" ? "Selfie profil gauche" : "Selfie profil gauche";
40
54
  case 'right':
41
- return 'Selfie profil droit';
55
+ return state.currentLanguage === "en" ? "Selfie profil droit" : "Selfie profil droit";
42
56
  default:
43
57
  return getLocalizedText(component.labels);
44
58
  }
45
59
  };
60
+ const getOrientationOpposite = (orientation) => {
61
+ switch (orientation) {
62
+ case 'center':
63
+ return 'center';
64
+ case 'left':
65
+ return 'left';
66
+ case 'right':
67
+ return 'right';
68
+ default:
69
+ return orientation;
70
+ }
71
+ };
72
+ // const countryData = useMemo(() => {
73
+ // const geCountryID = Object.keys(state.componentData).find((c: string) => c === "6");
74
+ // if (geCountryID) {
75
+ // const countryMapping = state.componentData[geCountryID];
76
+ // return countryMapping?.code;
77
+ // }
78
+ // return null;
79
+ // }, [state.componentData]);
46
80
  const getInstructions = (orientation) => {
81
+ const lang = state.currentLanguage;
47
82
  switch (orientation) {
48
- case 'front':
49
- return { title: 'Center your face', subtitle: 'Align your face to the center of the selfie area and then take a photo' };
83
+ case 'center':
84
+ return {
85
+ title: lang === "en" ? 'Center your face' : 'Mettez votre face au centre',
86
+ subtitle: lang === "en"
87
+ ? 'Align your face to the center of the selfie area and then take a photo'
88
+ : 'Alignez votre visage au centre de la zone selfie puis prenez une photo'
89
+ };
50
90
  case 'left':
51
- return { title: 'Turn your head left', subtitle: 'Slowly turn your head to the left while keeping your face in the selfie area' };
91
+ return {
92
+ title: lang === 'en'
93
+ ? 'Turn your head left'
94
+ : 'Tournez la tête vers la gauche',
95
+ subtitle: lang === 'en'
96
+ ? 'Slowly turn your head to the left while keeping your face in the selfie area'
97
+ : 'Tournez lentement la tête vers la gauche en gardant votre visage dans la zone selfie'
98
+ };
52
99
  case 'right':
53
- return { title: 'Turn your head right', subtitle: 'Slowly turn your head to the right while keeping your face in the selfie area' };
100
+ return {
101
+ title: lang === 'en'
102
+ ? 'Turn your head right'
103
+ : 'Tournez la tête vers la droite',
104
+ subtitle: lang === 'en'
105
+ ? 'Slowly turn your head to the right while keeping your face in the selfie area'
106
+ : 'Tournez lentement la tête vers la droite en gardant votre visage dans la zone selfie'
107
+ };
54
108
  default:
55
109
  return { title: getLocalizedText(component.labels), subtitle: getLocalizedText(component.instructions) };
56
110
  }
57
111
  };
58
- const handleCapture = (result) => {
112
+ const handleSilentCapture = (result) => {
113
+ if (silentCaptureResult.isAnalyzing) {
114
+ return;
115
+ }
59
116
  if (result.success && result.path) {
60
- const newImages = { ...capturedImages, [currentOrientation]: result.path };
117
+ setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: true, success: false, error: '' }));
118
+ selfieVerification(result.path).then((response) => {
119
+ if (response.length > 0) {
120
+ const res = response[0];
121
+ if (res?.orientation_direction === getOrientationOpposite(currentOrientation) && res?.capture) {
122
+ setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: true, error: '', path: result.path }));
123
+ }
124
+ else {
125
+ setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: 'Le selfie n\'est pas correct' }));
126
+ }
127
+ }
128
+ else {
129
+ setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: 'Le selfie n\'est pas correct' }));
130
+ }
131
+ }).catch((e) => {
132
+ setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: e?.message || 'Erreur de vérification du selfie' }));
133
+ });
134
+ }
135
+ };
136
+ const handleCapture = async (result) => {
137
+ console.log("handleCapturessss", silentCaptureResult);
138
+ if (silentCaptureResult.success && silentCaptureResult.path) {
139
+ const base64 = await pathToBase64(silentCaptureResult.path);
140
+ // Keep backward-compatible structure for UI validation and add *_base64 fields for backend payload
141
+ const newImages = {
142
+ ...capturedImages,
143
+ [currentOrientation]: { dir: silentCaptureResult.path, file: base64 },
144
+ };
61
145
  setCapturedImages(newImages);
62
146
  onValueChange(newImages);
63
147
  setShowCamera(false);
64
- setAttempts(0);
65
148
  // Passer à l'orientation suivante si disponible
66
149
  const currentIndex = orientations.indexOf(currentOrientation);
67
150
  if (currentIndex < orientations.length - 1) {
68
151
  setCurrentOrientation(orientations[currentIndex + 1]);
69
152
  }
70
153
  }
71
- else {
72
- const newAttempts = attempts + 1;
73
- setAttempts(newAttempts);
74
- if (newAttempts >= maxAttempts) {
75
- Alert.alert('Limite atteinte', `Vous avez atteint le nombre maximum de tentatives (${maxAttempts}).`);
76
- setShowCamera(false);
77
- }
78
- else {
79
- Alert.alert('Erreur', result.error || 'Impossible de prendre le selfie');
80
- }
81
- }
82
154
  };
155
+ const idCardData = useMemo(() => {
156
+ const idCardID = Object.keys(state.componentData).find((c) => c === "1");
157
+ if (idCardID) {
158
+ const _idCardData = state.componentData[idCardID];
159
+ return _idCardData;
160
+ }
161
+ return null;
162
+ }, [state.componentData]);
163
+ console.log("idCardData", truncateFields(idCardData), JSON.stringify(truncateFields(state.componentData), null, 2));
83
164
  const handleError = (event) => {
84
165
  Alert.alert('Erreur', event.message);
85
166
  setShowCamera(false);
@@ -90,9 +171,10 @@ export const SelfieCaptureTemplate = ({ component, value, onValueChange, error,
90
171
  const isAllOrientationsCompleted = () => {
91
172
  return orientations.every(orientation => isOrientationCompleted(orientation));
92
173
  };
174
+ console.log("Current Orientation", currentOrientation);
93
175
  if (showCamera) {
94
176
  return (<View style={styles.containerCamera}>
95
- <EnhancedCameraView instructions={getOrientationInstructions(currentOrientation)} showCamera={true} cameraType="front" style={styles.camera} onCapture={handleCapture} onError={handleError} onClose={() => setShowCamera(false)} quality="high" showCaptureButton={true} showSwitchCamera={false} enableFlash={false} overlayComponent={<SelfieOverlay xMin={20} yMin={140} xMax={370} yMax={340} cornerOpacity={1} instructions={""} orientation={currentOrientation} instructionsTile={getInstructions(currentOrientation).title} instructionsSubtitle={getInstructions(currentOrientation).subtitle} stepperProps={{
177
+ <EnhancedCameraView instructions={getOrientationInstructions(currentOrientation)} showCamera={true} cameraType="front" style={styles.camera} onCapture={handleCapture} onError={handleError} onClose={() => setShowCamera(false)} quality="high" showCaptureButton={true} showSwitchCamera={false} enableFlash={false} silentCaptureResult={silentCaptureResult} onSilentCapture={handleSilentCapture} overlayComponent={<SelfieOverlay xMin={20} yMin={140} xMax={370} yMax={340} cornerOpacity={1} instructions={""} language={state.currentLanguage} orientation={currentOrientation} instructionsTile={getInstructions(currentOrientation).title} instructionsSubtitle={getInstructions(currentOrientation).subtitle} stepperProps={{
96
178
  back: () => {
97
179
  setShowCamera(false);
98
180
  },
@@ -146,25 +228,42 @@ export const SelfieCaptureTemplate = ({ component, value, onValueChange, error,
146
228
  </View>))}
147
229
  <View style={{ backgroundColor: "#F6CB0D1A", width: "100%", padding: 10, borderRadius: 10 }}>
148
230
  <Text style={{ color: '#997E06', fontSize: 16, fontWeight: 'bold' }}>
149
- Tips for a good selfie:
231
+ {state.currentLanguage === "en"
232
+ ? "Tips for a good selfie:"
233
+ : "Conseils pour une bonne photo selfie :"}
150
234
  </Text>
151
235
  <View style={{ paddingLeft: 10, paddingTop: 4 }}>
152
236
  <Text style={{ color: '#997E06', fontSize: 14, fontWeight: 'bold' }}>
153
- {`• Remove glasses and hat \n• Look directly at the camera \n• Ensure good lighting \n`}
237
+ {state.currentLanguage === "en"
238
+ ? `• Remove glasses and hat \n• Look directly at the camera \n• Ensure good lighting \n`
239
+ : `• Retirez vos lunettes et votre chapeau \n• Regardez directement la caméra \n• Assurez-vous d'une bonne luminosité \n`}
154
240
  </Text>
155
241
  </View>
156
242
  </View>
157
243
  <View style={{ height: 10 }}/>
158
244
  {isAllOrientationsCompleted() ? <>
159
- <Button title="Continuer" fullWidth style={{ paddingVertical: 20, paddingTop: 12 }} onPress={() => {
160
- onValueChange(capturedImages);
245
+ <Button title={t('common.continue')} fullWidth style={{ paddingVertical: 20, paddingTop: 12 }} onPress={async () => {
246
+ if (idCardData?.country && idCardData?.documentType) {
247
+ const value = {
248
+ ...capturedImages,
249
+ country: idCardData?.country || '',
250
+ documentType: idCardData?.documentType,
251
+ };
252
+ console.log("value", JSON.stringify(truncateFields(value), null, 2));
253
+ onValueChange(value);
254
+ }
255
+ else {
256
+ Alert.alert('Erreur', 'Veuillez sélectionner un pays et un type de document');
257
+ return;
258
+ }
161
259
  actions.nextComponent();
162
260
  }}/>
163
- </> : (<Button title="Start Selfie" fullWidth style={{ paddingVertical: 20, paddingTop: 12 }} onPress={() => {
261
+ </> : (<Button title={t('kyc.selfieCapture.captureButton')} fullWidth style={{ paddingVertical: 20, paddingTop: 12 }} onPress={() => {
164
262
  if (isAllOrientationsCompleted()) {
165
- onValueChange(capturedImages);
263
+ actions.nextComponent();
166
264
  }
167
265
  else {
266
+ setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: '' }));
168
267
  setShowCamera(true);
169
268
  }
170
269
  }}/>)}
@@ -1 +1 @@
1
- {"version":3,"file":"SelfieCaptureTemplate.js","sourceRoot":"","sources":["../../../src/components/KYCElements/SelfieCaptureTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,aAAa,MAAM,0BAA0B,CAAC;AAUrD,MAAM,CAAC,MAAM,qBAAqB,GAAyC,CAAC,EAC1E,SAAS,EACT,KAAK,EACL,aAAa,EACb,KAAK,EACL,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,MAAM,GAAG,SAAS,CAAC,MAAsB,CAAC;IAChD,MAAM,WAAW,GAAG,MAAM,CAAC,YAAY,IAAI,CAAC,CAAC;IAC7C,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,IAAI,CAAC,OAAO,CAAC,CAAC;IACtD,MAAM,EAAE,OAAO,EAAE,KAAK,GAAG,GAAG,yBAAyB,EAAE,CAAC;IAExD,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CA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,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,eAAe,EAAE,SAAS;QAC1B,eAAe,EAAE,EAAE;QACnB,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,EAAE;QAChB,SAAS,EAAE,CAAC;KACb;IACD,WAAW,EAAE;QACX,QAAQ,EAAE,EAAE;QACZ,WAAW,EAAE,CAAC;KACf;IACD,WAAW,EAAE;QACX,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,OAAO;KACf;IACD,YAAY,EAAE;QACZ,eAAe,EAAE,SAAS;QAC1B,eAAe,EAAE,EAAE;QACnB,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,CAAC;KAChB;IACD,gBAAgB,EAAE;QAChB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,OAAO;KACf;IACD,mBAAmB,EAAE;QACnB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE,EAAE;KACZ;IACD,cAAc,EAAE;QACd,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,SAAS;QAChB,YAAY,EAAE,EAAE;KACjB;IACD,eAAe,EAAE;QACf,eAAe,EAAE,SAAS;QAC1B,eAAe,EAAE,EAAE;QACnB,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,CAAC;KAChB;IACD,mBAAmB,EAAE;QACnB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,OAAO;KACf;IACD,SAAS,EAAE;QACT,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,QAAQ;QACnB,SAAS,EAAE,EAAE;KACd;CACF,CAAC,CAAC","sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { View, Text, StyleSheet, Alert, ScrollView } from 'react-native';\nimport { TemplateComponent, SelfieConfig, LocalizedText } from '../../types/KYC.types';\nimport { EnhancedCameraView } from '../EnhancedCameraView';\nimport { Button } from '../ui/Button';\nimport { useTemplateKYCFlowContext } from '../../hooks/useTemplateKYCFlow';\nimport SelfieOverlay from '../OverLay/SelfieOverlay';\n\ninterface SelfieCaptureTemplateProps {\n component: TemplateComponent;\n value: Record<string, string> | undefined;\n onValueChange: (value: Record<string, string>) => void;\n error?: string;\n language: string;\n}\n\nexport const SelfieCaptureTemplate: React.FC<SelfieCaptureTemplateProps> = ({\n component,\n value,\n onValueChange,\n error,\n language,\n}) => {\n const config = component.config as SelfieConfig;\n const maxAttempts = config.max_attempts || 3;\n const orientations = config.orientations || ['front'];\n const { actions, state, } = useTemplateKYCFlowContext();\n\n const [showCamera, setShowCamera] = useState(false);\n const [currentOrientation, setCurrentOrientation] = useState<string>(orientations[0]);\n const [capturedImages, setCapturedImages] = useState<Record<string, string>>(value || {});\n const [attempts, setAttempts] = useState(0);\n\n const getLocalizedText = (text: LocalizedText): string => {\n return text[language] || text.en || '';\n };\n\n const getOrientationInstructions = (orientation: string): string => {\n switch (orientation) {\n case 'front':\n return 'Prenez un selfie de face, regardez droit devant vous';\n case 'left':\n return 'Tournez votre tête vers la gauche, gardez les épaules droites';\n case 'right':\n return 'Tournez votre tête vers la droite, gardez les épaules droites';\n default:\n return getLocalizedText(component.instructions);\n }\n };\n\n useEffect(() => {\n actions.showCustomStepper(!showCamera);\n }, [showCamera]);\n\n const getOrientationLabel = (orientation: string): string => {\n switch (orientation) {\n case 'front':\n return 'Selfie de face';\n case 'left':\n return 'Selfie profil gauche';\n case 'right':\n return 'Selfie profil droit';\n default:\n return getLocalizedText(component.labels);\n }\n };\n\n const getInstructions = (orientation: string): { title: string, subtitle: string } => {\n switch (orientation) {\n case 'front':\n return { title: 'Center your face', subtitle: 'Align your face to the center of the selfie area and then take a photo' };\n case 'left':\n return { title: 'Turn your head left', subtitle: 'Slowly turn your head to the left while keeping your face in the selfie area' };\n case 'right':\n return { title: 'Turn your head right', subtitle: 'Slowly turn your head to the right while keeping your face in the selfie area' };\n default:\n return { title: getLocalizedText(component.labels), subtitle: getLocalizedText(component.instructions) };\n }\n };\n\n const handleCapture = (result: { success: boolean; path?: string; error?: string }) => {\n if (result.success && result.path) {\n const newImages = { ...capturedImages, [currentOrientation]: result.path };\n setCapturedImages(newImages);\n onValueChange(newImages);\n setShowCamera(false);\n setAttempts(0);\n\n // Passer à l'orientation suivante si disponible\n const currentIndex = orientations.indexOf(currentOrientation as any);\n if (currentIndex < orientations.length - 1) {\n setCurrentOrientation(orientations[currentIndex + 1]);\n }\n } else {\n const newAttempts = attempts + 1;\n setAttempts(newAttempts);\n\n if (newAttempts >= maxAttempts) {\n Alert.alert(\n 'Limite atteinte',\n `Vous avez atteint le nombre maximum de tentatives (${maxAttempts}).`\n );\n setShowCamera(false);\n } else {\n Alert.alert('Erreur', result.error || 'Impossible de prendre le selfie');\n }\n }\n };\n\n const handleError = (event: { message: string }) => {\n Alert.alert('Erreur', event.message);\n setShowCamera(false);\n };\n\n\n const isOrientationCompleted = (orientation: string): boolean => {\n return !!capturedImages[orientation];\n };\n\n const isAllOrientationsCompleted = (): boolean => {\n return orientations.every(orientation => isOrientationCompleted(orientation));\n };\n\n if (showCamera) {\n return (\n <View style={styles.containerCamera}>\n <EnhancedCameraView\n instructions={getOrientationInstructions(currentOrientation)}\n showCamera={true}\n cameraType=\"front\"\n style={styles.camera}\n onCapture={handleCapture}\n onError={handleError}\n onClose={() => setShowCamera(false)}\n quality=\"high\"\n showCaptureButton={true}\n showSwitchCamera={false}\n enableFlash={false}\n overlayComponent={<SelfieOverlay\n xMin={20}\n yMin={140}\n xMax={370}\n yMax={340}\n cornerOpacity={1}\n instructions={\"\"}\n orientation={currentOrientation as 'front' | 'left' | 'right'}\n instructionsTile={getInstructions(currentOrientation).title}\n instructionsSubtitle={getInstructions(currentOrientation).subtitle}\n stepperProps={{\n back: () => {\n setShowCamera(false);\n },\n selectedDocumentType: \"Selfie\",\n step: state.currentComponentIndex + 1,\n totalSteps: state.template.components.length,\n }} />}\n />\n </View>\n );\n }\n\n\n return (\n <View style={[{\n maxWidth: 760,\n width: '100%',\n height: '100%',\n }]}>\n <View style={styles.container}>\n <Text style={styles.title}>{getLocalizedText(component.labels)}</Text>\n <Text style={styles.description}>{getLocalizedText(component.instructions)}</Text>\n\n <ScrollView style={styles.orientationsContainer} showsVerticalScrollIndicator={false}>\n <View style={{ flexDirection: 'column', alignItems: 'center', gap: 10 }}>\n\n {orientations.map((orientation, key) => (\n <View key={orientation} style={{\n backgroundColor: '#F3F4F6',\n borderRadius: 12,\n flexDirection: 'row',\n alignItems: 'center',\n gap: 10,\n width: '100%',\n paddingVertical: 10,\n paddingHorizontal: 10,\n }}>\n <View style={{\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: isOrientationCompleted(orientation) ? '#2DBE60' : '#D1D5DB',\n borderRadius: 100,\n width: 30,\n height: 30,\n }}>\n <Text style={{ color: 'white', fontSize: 16, fontWeight: 'bold' }}>{key + 1}</Text>\n </View>\n\n\n <Text style={styles.orientationTitle}>\n {getOrientationLabel(orientation)}\n </Text>\n\n\n\n </View>\n ))}\n <View style={{ backgroundColor: \"#F6CB0D1A\", width: \"100%\", padding: 10, borderRadius: 10 }} >\n <Text style={{ color: '#997E06', fontSize: 16, fontWeight: 'bold' }}>\n Tips for a good selfie:\n </Text>\n <View style={{ paddingLeft: 10, paddingTop: 4 }}>\n <Text style={{ color: '#997E06', fontSize: 14, fontWeight: 'bold' }}>\n {`• Remove glasses and hat \\n• Look directly at the camera \\n• Ensure good lighting \\n`}\n </Text>\n </View>\n </View>\n <View style={{ height: 10 }} />\n {isAllOrientationsCompleted() ? <>\n <Button title=\"Continuer\" fullWidth style={{ paddingVertical: 20, paddingTop: 12 }} onPress={() => {\n onValueChange(capturedImages);\n actions.nextComponent();\n }} />\n </> : (\n <Button title=\"Start Selfie\" fullWidth style={{ paddingVertical: 20, paddingTop: 12 }} onPress={() => {\n if (isAllOrientationsCompleted()) {\n onValueChange(capturedImages);\n } else {\n setShowCamera(true);\n }\n }} />\n )}\n\n </View>\n </ScrollView>\n\n {error && (\n <Text style={styles.errorText}>{error}</Text>\n )}\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n root: {\n flex: 1,\n paddingVertical: 10,\n },\n container: {\n backgroundColor: 'white',\n margin: 15,\n borderRadius: 20,\n paddingVertical: 20,\n paddingHorizontal: 16,\n // shadow\n shadowColor: '#000',\n shadowOffset: { width: 0, height: 2 },\n shadowOpacity: 0.35,\n shadowRadius: 4.84,\n elevation: 10,\n\n\n // padding: 16,\n },\n containerCamera: {\n flex: 1,\n // maxWidth: 760,\n width: '100%',\n height: '100%',\n // borderRadius: 12,\n backgroundColor: '#f5f5f5',\n },\n title: {\n fontSize: 24,\n fontWeight: 'bold',\n color: '#333',\n marginBottom: 8,\n textAlign: 'center',\n },\n description: {\n fontSize: 16,\n color: '#666',\n marginBottom: 20,\n lineHeight: 22,\n textAlign: 'center',\n },\n camera: {\n flex: 1,\n // borderRadius: 12,\n overflow: 'hidden',\n },\n attemptsText: {\n fontSize: 14,\n color: '#666',\n textAlign: 'center',\n marginBottom: 10,\n },\n orientationsContainer: {\n // flex: 1,\n },\n orientationContainer: {\n backgroundColor: 'white',\n borderRadius: 12,\n padding: 16,\n marginBottom: 16,\n shadowColor: '#000',\n shadowOffset: {\n width: 0,\n height: 2,\n },\n shadowOpacity: 0.1,\n shadowRadius: 3.84,\n elevation: 5,\n },\n orientationTitle: {\n fontSize: 18,\n fontWeight: '600',\n color: '#333',\n // marginBottom: 12,\n },\n capturedImageContainer: {\n alignItems: 'center',\n },\n capturedImage: {\n width: 200,\n height: 200,\n borderRadius: 12,\n marginBottom: 12,\n },\n captureButton: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: '#2DBD60',\n paddingVertical: 16,\n paddingHorizontal: 24,\n borderRadius: 12,\n marginTop: 8,\n },\n captureIcon: {\n fontSize: 24,\n marginRight: 8,\n },\n captureText: {\n fontSize: 16,\n fontWeight: '600',\n color: 'white',\n },\n retakeButton: {\n backgroundColor: '#FF6B6B',\n paddingVertical: 12,\n paddingHorizontal: 20,\n borderRadius: 8,\n },\n retakeButtonText: {\n fontSize: 14,\n fontWeight: '600',\n color: 'white',\n },\n completionContainer: {\n alignItems: 'center',\n padding: 20,\n },\n completionText: {\n fontSize: 18,\n fontWeight: '600',\n color: '#2DBD60',\n marginBottom: 16,\n },\n retakeAllButton: {\n backgroundColor: '#FF6B6B',\n paddingVertical: 12,\n paddingHorizontal: 20,\n borderRadius: 8,\n },\n retakeAllButtonText: {\n fontSize: 14,\n fontWeight: '600',\n color: 'white',\n },\n errorText: {\n color: '#dc2626',\n fontSize: 14,\n textAlign: 'center',\n marginTop: 10,\n },\n}); "]}
1
+ {"version":3,"file":"SelfieCaptureTemplate.js","sourceRoot":"","sources":["../../../src/components/KYCElements/SelfieCaptureTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,aAAa,MAAM,0BAA0B,CAAC;AACrD,OAAO,kBAAkB,MAAM,sCAAsC,CAAC;AACtE,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAc9D,MAAM,CAAC,MAAM,qBAAqB,GAAyC,CAAC,EAC1E,SAAS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,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,CAAC;KAChB;IACD,mBAAmB,EAAE;QACnB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,OAAO;KACf;IACD,SAAS,EAAE;QACT,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,QAAQ;QACnB,SAAS,EAAE,EAAE;KACd;CACF,CAAC,CAAC","sourcesContent":["import React, { useEffect, useMemo, useState } from 'react';\nimport { View, Text, StyleSheet, Alert, ScrollView } from 'react-native';\nimport { TemplateComponent, SelfieConfig, LocalizedText, ISilentCaptureResult, OrientationType, GovernmentDocumentType } from '../../types/KYC.types';\nimport { EnhancedCameraView } from '../EnhancedCameraView';\nimport { Button } from '../ui/Button';\nimport { useTemplateKYCFlowContext } from '../../hooks/useTemplateKYCFlow';\nimport { useI18n } from '../../hooks/useI18n';\nimport SelfieOverlay from '../OverLay/SelfieOverlay';\nimport selfieVerification from '../../modules/api/SelfieVerification';\nimport pathToBase64 from '../../utils/pathToBase64';\nimport { truncateFields } from '../../modules/api/KYCService';\n\ninterface IImagePayload {\n dir: string;\n file: string;\n}\ninterface SelfieCaptureTemplateProps {\n component: TemplateComponent;\n value: Record<string, IImagePayload> | undefined;\n onValueChange: (value: Record<string, IImagePayload | string>) => void;\n error?: string;\n language: string;\n}\n\nexport const SelfieCaptureTemplate: React.FC<SelfieCaptureTemplateProps> = ({\n component,\n value,\n onValueChange,\n error,\n language,\n}) => {\n const { t } = useI18n();\n const config = component.config as SelfieConfig;\n const orientations: OrientationType[] = (config.orientations || ['center']) as OrientationType[];\n const { actions, state, } = useTemplateKYCFlowContext();\n\n const [silentCaptureResult, setSilentCaptureResult] = useState<ISilentCaptureResult>({ success: false, isAnalyzing: false });\n\n\n const [showCamera, setShowCamera] = useState(false);\n const [currentOrientation, setCurrentOrientation] = useState<OrientationType>(orientations[0]);\n const [capturedImages, setCapturedImages] = useState<Record<string, IImagePayload>>(value || {});\n\n const getLocalizedText = (text: LocalizedText | Record<string, LocalizedText>): string => {\n if (!text) return '';\n // If text is a nested record (e.g., per theme/device), try to pick a default then localize\n const maybeNested = text as Record<string, LocalizedText>;\n if (maybeNested && typeof maybeNested === 'object' && 'en' in maybeNested === false && 'fr' in maybeNested === false) {\n const firstKey = Object.keys(maybeNested)[0];\n const nested = maybeNested[firstKey] as LocalizedText;\n return nested?.[language] || nested?.en || '';\n }\n const loc = text as LocalizedText;\n return loc[language] || loc.en || '';\n };\n\n const getOrientationInstructions = (orientation: OrientationType): string => {\n switch (orientation) {\n case 'center':\n return state.currentLanguage === \"en\" ? \"Take a selfie of face, look straight ahead you\" : \"Prenez un selfie de face, regardez droit devant vous\";\n case 'left':\n return state.currentLanguage === \"en\" ? \"Turn your head to the left, keep your shoulders straight\" : \"Tournez votre tête vers la gauche, gardez les épaules droites\";\n case 'right':\n return state.currentLanguage === \"en\" ? \"Turn your head to the right, keep your shoulders straight\" : \"Tournez votre tête vers la droite, gardez les épaules droites\";\n default:\n return getLocalizedText(component.instructions as LocalizedText);\n }\n };\n\n useEffect(() => {\n actions.showCustomStepper(!showCamera);\n }, [showCamera]);\n\n const getOrientationLabel = (orientation: OrientationType): string => {\n switch (orientation) {\n case 'center':\n return state.currentLanguage === \"en\" ? \"Selfie de face\" : \"Selfie de face\";\n case 'left':\n return state.currentLanguage === \"en\" ? \"Selfie profil gauche\" : \"Selfie profil gauche\";\n case 'right':\n return state.currentLanguage === \"en\" ? \"Selfie profil droit\" : \"Selfie profil droit\";\n default:\n return getLocalizedText(component.labels as LocalizedText);\n }\n };\n const getOrientationOpposite = (orientation: OrientationType): OrientationType => {\n switch (orientation) {\n case 'center':\n\n return 'center';\n case 'left':\n return 'left';\n case 'right':\n return 'right';\n default:\n return orientation;\n }\n }\n // const countryData = useMemo(() => {\n // const geCountryID = Object.keys(state.componentData).find((c: string) => c === \"6\");\n\n // if (geCountryID) {\n // const countryMapping = state.componentData[geCountryID];\n // return countryMapping?.code;\n // }\n // return null;\n // }, [state.componentData]);\n\n const getInstructions = (orientation: OrientationType): { title: string, subtitle: string } => {\n const lang = state.currentLanguage;\n switch (orientation) {\n case 'center':\n return {\n title:\n\n lang === \"en\" ? 'Center your face' : 'Mettez votre face au centre',\n subtitle: lang === \"en\"\n ? 'Align your face to the center of the selfie area and then take a photo'\n : 'Alignez votre visage au centre de la zone selfie puis prenez une photo'\n };\n case 'left':\n return {\n title:\n lang === 'en'\n ? 'Turn your head left'\n : 'Tournez la tête vers la gauche',\n subtitle:\n lang === 'en'\n ? 'Slowly turn your head to the left while keeping your face in the selfie area'\n : 'Tournez lentement la tête vers la gauche en gardant votre visage dans la zone selfie'\n };\n case 'right':\n return {\n title:\n lang === 'en'\n ? 'Turn your head right'\n : 'Tournez la tête vers la droite',\n subtitle:\n lang === 'en'\n ? 'Slowly turn your head to the right while keeping your face in the selfie area'\n : 'Tournez lentement la tête vers la droite en gardant votre visage dans la zone selfie'\n };\n default:\n return { title: getLocalizedText(component.labels as LocalizedText), subtitle: getLocalizedText(component.instructions as LocalizedText) };\n }\n };\n\n const handleSilentCapture = (result: { success: boolean; path?: string; error?: string }) => {\n if (silentCaptureResult.isAnalyzing) {\n return;\n }\n if (result.success && result.path) {\n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: true, success: false, error: '' }));\n selfieVerification(result.path).then((response) => {\n if (response.length > 0) {\n const res = response[0];\n if (res?.orientation_direction === getOrientationOpposite(currentOrientation) && res?.capture) {\n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: true, error: '', path: result.path }));\n } else {\n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: 'Le selfie n\\'est pas correct' }));\n }\n } else {\n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: 'Le selfie n\\'est pas correct' }));\n }\n }).catch((e: any) => {\n\n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: e?.message || 'Erreur de vérification du selfie' }));\n });\n }\n }\n\n const handleCapture = async (result: { success: boolean; path?: string; error?: string }) => {\n console.log(\"handleCapturessss\", silentCaptureResult);\n\n if (silentCaptureResult.success && silentCaptureResult.path) {\n const base64 = await pathToBase64(silentCaptureResult.path);\n // Keep backward-compatible structure for UI validation and add *_base64 fields for backend payload\n const newImages: Record<string, any> = {\n ...capturedImages,\n [currentOrientation]: { dir: silentCaptureResult.path, file: base64 } as IImagePayload,\n };\n setCapturedImages(newImages);\n onValueChange(newImages);\n setShowCamera(false);\n\n\n // Passer à l'orientation suivante si disponible\n const currentIndex = orientations.indexOf(currentOrientation as OrientationType);\n if (currentIndex < orientations.length - 1) {\n setCurrentOrientation(orientations[currentIndex + 1]);\n }\n }\n };\n const idCardData = useMemo(() => {\n const idCardID = Object.keys(state.componentData).find((c: string) => c === \"1\");\n if (idCardID) {\n const _idCardData = state.componentData[idCardID];\n return _idCardData as unknown as { country: string; documentType: GovernmentDocumentType };\n }\n return null;\n }, [state.componentData]);\n console.log(\"idCardData\", truncateFields(idCardData), JSON.stringify(truncateFields(state.componentData), null, 2));\n\n\n const handleError = (event: { message: string }) => {\n Alert.alert('Erreur', event.message);\n setShowCamera(false);\n };\n\n\n const isOrientationCompleted = (orientation: OrientationType): boolean => {\n return !!capturedImages[orientation];\n };\n\n const isAllOrientationsCompleted = (): boolean => {\n return orientations.every(orientation => isOrientationCompleted(orientation));\n };\n console.log(\"Current Orientation\", currentOrientation);\n\n\n if (showCamera) {\n return (\n <View style={styles.containerCamera}>\n <EnhancedCameraView\n instructions={getOrientationInstructions(currentOrientation)}\n showCamera={true}\n cameraType=\"front\"\n style={styles.camera}\n onCapture={handleCapture}\n onError={handleError}\n onClose={() => setShowCamera(false)}\n quality=\"high\"\n showCaptureButton={true}\n showSwitchCamera={false}\n enableFlash={false}\n silentCaptureResult={silentCaptureResult}\n onSilentCapture={handleSilentCapture}\n overlayComponent={<SelfieOverlay\n xMin={20}\n yMin={140}\n xMax={370}\n yMax={340}\n cornerOpacity={1}\n instructions={\"\"}\n language={state.currentLanguage}\n orientation={currentOrientation as 'center' | 'left' | 'right'}\n instructionsTile={getInstructions(currentOrientation).title}\n instructionsSubtitle={getInstructions(currentOrientation).subtitle}\n stepperProps={{\n back: () => {\n setShowCamera(false);\n },\n selectedDocumentType: \"Selfie\",\n step: state.currentComponentIndex + 1,\n totalSteps: state.template.components.length,\n }} />}\n />\n </View>\n );\n }\n\n return (\n <View style={[{\n maxWidth: 760,\n width: '100%',\n height: '100%',\n }]}>\n <View style={styles.container}>\n <Text style={styles.title}>{getLocalizedText(component.labels as LocalizedText)}</Text>\n <Text style={styles.description}>{getLocalizedText(component.instructions as LocalizedText)}</Text>\n\n <ScrollView style={styles.orientationsContainer} showsVerticalScrollIndicator={false}>\n <View style={{ flexDirection: 'column', alignItems: 'center', gap: 10 }}>\n\n {orientations.map((orientation, key) => (\n <View key={orientation} style={{\n backgroundColor: '#F3F4F6',\n borderRadius: 12,\n flexDirection: 'row',\n alignItems: 'center',\n gap: 10,\n width: '100%',\n paddingVertical: 10,\n paddingHorizontal: 10,\n }}>\n <View style={{\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: isOrientationCompleted(orientation) ? '#2DBE60' : '#D1D5DB',\n borderRadius: 100,\n width: 30,\n height: 30,\n }}>\n <Text style={{ color: 'white', fontSize: 16, fontWeight: 'bold' }}>{key + 1}</Text>\n </View>\n\n\n <Text style={styles.orientationTitle}>\n {getOrientationLabel(orientation)}\n </Text>\n\n\n\n </View>\n ))}\n <View style={{ backgroundColor: \"#F6CB0D1A\", width: \"100%\", padding: 10, borderRadius: 10 }} >\n <Text style={{ color: '#997E06', fontSize: 16, fontWeight: 'bold' }}>\n {state.currentLanguage === \"en\"\n ? \"Tips for a good selfie:\"\n : \"Conseils pour une bonne photo selfie :\"}\n </Text>\n <View style={{ paddingLeft: 10, paddingTop: 4 }}>\n <Text style={{ color: '#997E06', fontSize: 14, fontWeight: 'bold' }}>\n {state.currentLanguage === \"en\"\n ? `• Remove glasses and hat \\n• Look directly at the camera \\n• Ensure good lighting \\n`\n : `• Retirez vos lunettes et votre chapeau \\n• Regardez directement la caméra \\n• Assurez-vous d'une bonne luminosité \\n`\n }\n </Text>\n </View>\n </View>\n <View style={{ height: 10 }} />\n {isAllOrientationsCompleted() ? <>\n <Button title={t('common.continue')} fullWidth style={{ paddingVertical: 20, paddingTop: 12 }} onPress={async () => {\n if (idCardData?.country && idCardData?.documentType) {\n const value = {\n ...capturedImages,\n country: idCardData?.country || '',\n documentType: idCardData?.documentType as GovernmentDocumentType,\n }\n console.log(\"value\", JSON.stringify(truncateFields(value), null, 2));\n onValueChange(value);\n } else {\n Alert.alert('Erreur', 'Veuillez sélectionner un pays et un type de document');\n return;\n }\n actions.nextComponent();\n }} />\n </> : (\n <Button title={t('kyc.selfieCapture.captureButton')} fullWidth style={{ paddingVertical: 20, paddingTop: 12 }} onPress={() => {\n if (isAllOrientationsCompleted()) {\n\n actions.nextComponent();\n } else {\n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: '' }));\n setShowCamera(true);\n }\n }} />\n )}\n\n </View>\n </ScrollView>\n\n {error && (\n <Text style={styles.errorText}>{error}</Text>\n )}\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n root: {\n flex: 1,\n paddingVertical: 10,\n },\n container: {\n backgroundColor: 'white',\n margin: 15,\n borderRadius: 20,\n paddingVertical: 20,\n paddingHorizontal: 16,\n // shadow\n shadowColor: '#000',\n shadowOffset: { width: 0, height: 2 },\n shadowOpacity: 0.35,\n shadowRadius: 4.84,\n elevation: 10,\n\n\n // padding: 16,\n },\n containerCamera: {\n flex: 1,\n // maxWidth: 760,\n width: '100%',\n height: '100%',\n // borderRadius: 12,\n backgroundColor: '#f5f5f5',\n },\n title: {\n fontSize: 24,\n fontWeight: 'bold',\n color: '#333',\n marginBottom: 8,\n textAlign: 'center',\n },\n description: {\n fontSize: 16,\n color: '#666',\n marginBottom: 20,\n lineHeight: 22,\n textAlign: 'center',\n },\n camera: {\n flex: 1,\n // borderRadius: 12,\n overflow: 'hidden',\n },\n attemptsText: {\n fontSize: 14,\n color: '#666',\n textAlign: 'center',\n marginBottom: 10,\n },\n orientationsContainer: {\n // flex: 1,\n },\n orientationContainer: {\n backgroundColor: 'white',\n borderRadius: 12,\n padding: 16,\n marginBottom: 16,\n shadowColor: '#000',\n shadowOffset: {\n width: 0,\n height: 2,\n },\n shadowOpacity: 0.1,\n shadowRadius: 3.84,\n elevation: 5,\n },\n orientationTitle: {\n fontSize: 18,\n fontWeight: '600',\n color: '#333',\n // marginBottom: 12,\n },\n capturedImageContainer: {\n alignItems: 'center',\n },\n capturedImage: {\n width: 200,\n height: 200,\n borderRadius: 12,\n marginBottom: 12,\n },\n captureButton: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: '#2DBD60',\n paddingVertical: 16,\n paddingHorizontal: 24,\n borderRadius: 12,\n marginTop: 8,\n },\n captureIcon: {\n fontSize: 24,\n marginRight: 8,\n },\n captureText: {\n fontSize: 16,\n fontWeight: '600',\n color: 'white',\n },\n retakeButton: {\n backgroundColor: '#FF6B6B',\n paddingVertical: 12,\n paddingHorizontal: 20,\n borderRadius: 8,\n },\n retakeButtonText: {\n fontSize: 14,\n fontWeight: '600',\n color: 'white',\n },\n completionContainer: {\n alignItems: 'center',\n padding: 20,\n },\n completionText: {\n fontSize: 18,\n fontWeight: '600',\n color: '#2DBD60',\n marginBottom: 16,\n },\n retakeAllButton: {\n backgroundColor: '#FF6B6B',\n paddingVertical: 12,\n paddingHorizontal: 20,\n borderRadius: 8,\n },\n retakeAllButtonText: {\n fontSize: 14,\n fontWeight: '600',\n color: 'white',\n },\n errorText: {\n color: '#dc2626',\n fontSize: 14,\n textAlign: 'center',\n marginTop: 10,\n },\n}); "]}