datakeen-session-react 1.1.180 → 1.1.182
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitlab-ci.yml +115 -46
- package/dist/cjs/components/document-collection/DocumentCollection.js +12 -7
- package/dist/cjs/components/document-collection/DocumentCollection.js.map +1 -1
- package/dist/cjs/components/document-collection/DocumentError.js +16 -12
- package/dist/cjs/components/document-collection/DocumentError.js.map +1 -1
- package/dist/cjs/components/document-collection/DocumentProcessing.js +17 -5
- package/dist/cjs/components/document-collection/DocumentProcessing.js.map +1 -1
- package/dist/cjs/components/jdi/JDIError.js +14 -10
- package/dist/cjs/components/jdi/JDIError.js.map +1 -1
- package/dist/cjs/components/jdi/JDIProcessing.js +13 -5
- package/dist/cjs/components/jdi/JDIProcessing.js.map +1 -1
- package/dist/cjs/components/session/DocumentCheck.js +15 -10
- package/dist/cjs/components/session/DocumentCheck.js.map +1 -1
- package/dist/cjs/components/session/Selfie.js +3 -1
- package/dist/cjs/components/session/Selfie.js.map +1 -1
- package/dist/cjs/components/session/UserInputForm/AddressFields.js +1 -1
- package/dist/cjs/components/session/UserInputForm/AddressFields.js.map +1 -1
- package/dist/cjs/components/session/UserInputForm/LegalRepFields.js +5 -1
- package/dist/cjs/components/session/UserInputForm/LegalRepFields.js.map +1 -1
- package/dist/cjs/components/signature-electronic/SignatureElectronic.js +17 -4
- package/dist/cjs/components/signature-electronic/SignatureElectronic.js.map +1 -1
- package/dist/cjs/components/signature-electronic/SignedDocumentPreview.js +130 -0
- package/dist/cjs/components/signature-electronic/SignedDocumentPreview.js.map +1 -0
- package/dist/cjs/components/template/ExternalVerificationNodeHandler.js +93 -45
- package/dist/cjs/components/template/ExternalVerificationNodeHandler.js.map +1 -1
- package/dist/cjs/constants/userInputForm.js.map +1 -1
- package/dist/cjs/hooks/useUserInputForm.js +11 -1
- package/dist/cjs/hooks/useUserInputForm.js.map +1 -1
- package/dist/cjs/i18n/en.json.js +9 -3
- package/dist/cjs/i18n/en.json.js.map +1 -1
- package/dist/cjs/i18n/fr.json.js +9 -3
- package/dist/cjs/i18n/fr.json.js.map +1 -1
- package/dist/cjs/index.css.js +1 -1
- package/dist/cjs/types/session.js.map +1 -1
- package/dist/cjs/utils/analysisErrors.js +22 -0
- package/dist/cjs/utils/analysisErrors.js.map +1 -0
- package/dist/esm/components/document-collection/DocumentCollection.js +12 -7
- package/dist/esm/components/document-collection/DocumentCollection.js.map +1 -1
- package/dist/esm/components/document-collection/DocumentError.js +17 -13
- package/dist/esm/components/document-collection/DocumentError.js.map +1 -1
- package/dist/esm/components/document-collection/DocumentProcessing.js +17 -5
- package/dist/esm/components/document-collection/DocumentProcessing.js.map +1 -1
- package/dist/esm/components/jdi/JDIError.js +15 -11
- package/dist/esm/components/jdi/JDIError.js.map +1 -1
- package/dist/esm/components/jdi/JDIProcessing.js +13 -5
- package/dist/esm/components/jdi/JDIProcessing.js.map +1 -1
- package/dist/esm/components/session/DocumentCheck.js +15 -10
- package/dist/esm/components/session/DocumentCheck.js.map +1 -1
- package/dist/esm/components/session/Selfie.js +3 -1
- package/dist/esm/components/session/Selfie.js.map +1 -1
- package/dist/esm/components/session/UserInputForm/AddressFields.js +1 -1
- package/dist/esm/components/session/UserInputForm/AddressFields.js.map +1 -1
- package/dist/esm/components/session/UserInputForm/LegalRepFields.js +5 -1
- package/dist/esm/components/session/UserInputForm/LegalRepFields.js.map +1 -1
- package/dist/esm/components/signature-electronic/SignatureElectronic.js +17 -4
- package/dist/esm/components/signature-electronic/SignatureElectronic.js.map +1 -1
- package/dist/esm/components/signature-electronic/SignedDocumentPreview.js +126 -0
- package/dist/esm/components/signature-electronic/SignedDocumentPreview.js.map +1 -0
- package/dist/esm/components/template/ExternalVerificationNodeHandler.js +94 -46
- package/dist/esm/components/template/ExternalVerificationNodeHandler.js.map +1 -1
- package/dist/esm/constants/userInputForm.js.map +1 -1
- package/dist/esm/hooks/useUserInputForm.js +11 -1
- package/dist/esm/hooks/useUserInputForm.js.map +1 -1
- package/dist/esm/i18n/en.json.js +9 -3
- package/dist/esm/i18n/en.json.js.map +1 -1
- package/dist/esm/i18n/fr.json.js +9 -3
- package/dist/esm/i18n/fr.json.js.map +1 -1
- package/dist/esm/index.css.js +1 -1
- package/dist/esm/types/session.js.map +1 -1
- package/dist/esm/utils/analysisErrors.js +19 -0
- package/dist/esm/utils/analysisErrors.js.map +1 -0
- package/package.json +1 -1
package/.gitlab-ci.yml
CHANGED
|
@@ -128,27 +128,50 @@ build:
|
|
|
128
128
|
publish:main:
|
|
129
129
|
stage: publish
|
|
130
130
|
image: node:24
|
|
131
|
-
|
|
132
|
-
variables:
|
|
133
|
-
NPM_CONFIG_PROVENANCE: "false"
|
|
134
|
-
|
|
135
|
-
id_tokens:
|
|
136
|
-
NPM_ID_TOKEN:
|
|
137
|
-
aud: "npm:registry.npmjs.org"
|
|
138
|
-
|
|
139
|
-
environment:
|
|
140
|
-
name: npm
|
|
141
|
-
url: https://www.npmjs.com/package/datakeen-session-react
|
|
142
|
-
|
|
143
131
|
script:
|
|
144
132
|
- git config user.email "ci@datakeen.io"
|
|
145
133
|
- git config user.name "Datakeen CI"
|
|
146
|
-
- git remote set-url origin https://${CI_PUSH_USER}:${CI_PUSH_TOKEN}@gitlab.
|
|
134
|
+
- git remote set-url origin https://${CI_PUSH_USER}:${CI_PUSH_TOKEN}@gitlab.datakeen.co/datakeenteam/teamfullstack/client-sessions-react-sdk.git
|
|
147
135
|
- 'npm version patch -m "chore(release): %s"'
|
|
136
|
+
- export TARGET_TAG="v$(node -p "require('./package.json').version")"
|
|
148
137
|
- git push -o ci.skip origin HEAD:main
|
|
149
138
|
- git push -o ci.skip origin --tags
|
|
150
|
-
- npm
|
|
151
|
-
|
|
139
|
+
- git remote add relay "https://oauth2:${RELAY_API_TOKEN}@gitlab.com/datakeen-ci-relay/npm-publish-relay.git" 2>/dev/null || git remote set-url relay "https://oauth2:${RELAY_API_TOKEN}@gitlab.com/datakeen-ci-relay/npm-publish-relay.git"
|
|
140
|
+
- git checkout --orphan "relay-snapshot-${CI_JOB_ID}"
|
|
141
|
+
- git add -A
|
|
142
|
+
- git commit -m "snapshot for npm publish ${TARGET_TAG}" --quiet
|
|
143
|
+
- git push relay "HEAD:refs/heads/${TARGET_TAG}"
|
|
144
|
+
- |
|
|
145
|
+
set -x
|
|
146
|
+
HTTP_CODE=$(curl -sS -o /tmp/trigger_response.json -w "%{http_code}" -X POST \
|
|
147
|
+
--header "PRIVATE-TOKEN: ${RELAY_API_TOKEN}" \
|
|
148
|
+
--header "Content-Type: application/json" \
|
|
149
|
+
--data "{\"ref\":\"${TARGET_TAG}\"}" \
|
|
150
|
+
"https://gitlab.com/api/v4/projects/${RELAY_PROJECT_ID}/pipeline")
|
|
151
|
+
echo "HTTP status: $HTTP_CODE"
|
|
152
|
+
cat /tmp/trigger_response.json
|
|
153
|
+
if [ "$HTTP_CODE" -ge 400 ]; then
|
|
154
|
+
echo "Echec du trigger, voir la reponse ci-dessus"
|
|
155
|
+
exit 1
|
|
156
|
+
fi
|
|
157
|
+
PIPELINE_ID=$(node -pe "JSON.parse(require('fs').readFileSync('/tmp/trigger_response.json','utf8')).id")
|
|
158
|
+
echo "relay pipeline triggered: $PIPELINE_ID for $TARGET_TAG"
|
|
159
|
+
for i in $(seq 1 60); do
|
|
160
|
+
STATUS_CODE=$(curl -sS -o /tmp/status_response.json -w "%{http_code}" \
|
|
161
|
+
--header "PRIVATE-TOKEN: ${RELAY_API_TOKEN}" \
|
|
162
|
+
"https://gitlab.com/api/v4/projects/${RELAY_PROJECT_ID}/pipelines/${PIPELINE_ID}")
|
|
163
|
+
STATUS=$(node -pe "JSON.parse(require('fs').readFileSync('/tmp/status_response.json','utf8')).status" 2>/dev/null || echo "parse_error")
|
|
164
|
+
echo "poll #$i - http:$STATUS_CODE - pipeline status: $STATUS"
|
|
165
|
+
case "$STATUS" in
|
|
166
|
+
success)
|
|
167
|
+
curl -sS -X DELETE --header "PRIVATE-TOKEN: ${RELAY_API_TOKEN}" "https://gitlab.com/api/v4/projects/${RELAY_PROJECT_ID}/repository/branches/${TARGET_TAG}" > /dev/null || true
|
|
168
|
+
exit 0
|
|
169
|
+
;;
|
|
170
|
+
failed|canceled) echo "publish relais en echec"; cat /tmp/status_response.json; exit 1 ;;
|
|
171
|
+
esac
|
|
172
|
+
sleep 10
|
|
173
|
+
done
|
|
174
|
+
echo "timeout en attendant le relais"; exit 1
|
|
152
175
|
rules:
|
|
153
176
|
- if: '$CI_COMMIT_BRANCH == "main" && $CI_PIPELINE_SOURCE != "merge_request_event"'
|
|
154
177
|
needs:
|
|
@@ -158,27 +181,50 @@ publish:main:
|
|
|
158
181
|
publish:staging:
|
|
159
182
|
stage: publish
|
|
160
183
|
image: node:24
|
|
161
|
-
|
|
162
|
-
variables:
|
|
163
|
-
NPM_CONFIG_PROVENANCE: "false"
|
|
164
|
-
|
|
165
|
-
id_tokens:
|
|
166
|
-
NPM_ID_TOKEN:
|
|
167
|
-
aud: "npm:registry.npmjs.org"
|
|
168
|
-
|
|
169
|
-
environment:
|
|
170
|
-
name: npm
|
|
171
|
-
url: https://www.npmjs.com/package/datakeen-session-react?activeTab=versions
|
|
172
|
-
|
|
173
184
|
script:
|
|
174
185
|
- git config user.email "ci@datakeen.io"
|
|
175
186
|
- git config user.name "Datakeen CI"
|
|
176
|
-
- git remote set-url origin https://${CI_PUSH_USER}:${CI_PUSH_TOKEN}@gitlab.
|
|
187
|
+
- git remote set-url origin https://${CI_PUSH_USER}:${CI_PUSH_TOKEN}@gitlab.datakeen.co/datakeenteam/teamfullstack/client-sessions-react-sdk.git
|
|
177
188
|
- 'npm version prerelease --preid=rc -m "chore(release): %s"'
|
|
189
|
+
- export TARGET_TAG="v$(node -p "require('./package.json').version")"
|
|
178
190
|
- git push -o ci.skip origin HEAD:staging
|
|
179
191
|
- git push -o ci.skip origin --tags
|
|
180
|
-
- npm
|
|
181
|
-
|
|
192
|
+
- git remote add relay "https://oauth2:${RELAY_API_TOKEN}@gitlab.com/datakeen-ci-relay/npm-publish-relay.git" 2>/dev/null || git remote set-url relay "https://oauth2:${RELAY_API_TOKEN}@gitlab.com/datakeen-ci-relay/npm-publish-relay.git"
|
|
193
|
+
- git checkout --orphan "relay-snapshot-${CI_JOB_ID}"
|
|
194
|
+
- git add -A
|
|
195
|
+
- git commit -m "snapshot for npm publish ${TARGET_TAG}" --quiet
|
|
196
|
+
- git push relay "HEAD:refs/heads/${TARGET_TAG}"
|
|
197
|
+
- |
|
|
198
|
+
set -x
|
|
199
|
+
HTTP_CODE=$(curl -sS -o /tmp/trigger_response.json -w "%{http_code}" -X POST \
|
|
200
|
+
--header "PRIVATE-TOKEN: ${RELAY_API_TOKEN}" \
|
|
201
|
+
--header "Content-Type: application/json" \
|
|
202
|
+
--data "{\"ref\":\"${TARGET_TAG}\"}" \
|
|
203
|
+
"https://gitlab.com/api/v4/projects/${RELAY_PROJECT_ID}/pipeline")
|
|
204
|
+
echo "HTTP status: $HTTP_CODE"
|
|
205
|
+
cat /tmp/trigger_response.json
|
|
206
|
+
if [ "$HTTP_CODE" -ge 400 ]; then
|
|
207
|
+
echo "Echec du trigger, voir la reponse ci-dessus"
|
|
208
|
+
exit 1
|
|
209
|
+
fi
|
|
210
|
+
PIPELINE_ID=$(node -pe "JSON.parse(require('fs').readFileSync('/tmp/trigger_response.json','utf8')).id")
|
|
211
|
+
echo "relay pipeline triggered: $PIPELINE_ID for $TARGET_TAG"
|
|
212
|
+
for i in $(seq 1 60); do
|
|
213
|
+
STATUS_CODE=$(curl -sS -o /tmp/status_response.json -w "%{http_code}" \
|
|
214
|
+
--header "PRIVATE-TOKEN: ${RELAY_API_TOKEN}" \
|
|
215
|
+
"https://gitlab.com/api/v4/projects/${RELAY_PROJECT_ID}/pipelines/${PIPELINE_ID}")
|
|
216
|
+
STATUS=$(node -pe "JSON.parse(require('fs').readFileSync('/tmp/status_response.json','utf8')).status" 2>/dev/null || echo "parse_error")
|
|
217
|
+
echo "poll #$i - http:$STATUS_CODE - pipeline status: $STATUS"
|
|
218
|
+
case "$STATUS" in
|
|
219
|
+
success)
|
|
220
|
+
curl -sS -X DELETE --header "PRIVATE-TOKEN: ${RELAY_API_TOKEN}" "https://gitlab.com/api/v4/projects/${RELAY_PROJECT_ID}/repository/branches/${TARGET_TAG}" > /dev/null || true
|
|
221
|
+
exit 0
|
|
222
|
+
;;
|
|
223
|
+
failed|canceled) echo "publish relais en echec"; cat /tmp/status_response.json; exit 1 ;;
|
|
224
|
+
esac
|
|
225
|
+
sleep 10
|
|
226
|
+
done
|
|
227
|
+
echo "timeout en attendant le relais"; exit 1
|
|
182
228
|
rules:
|
|
183
229
|
- if: '$CI_COMMIT_BRANCH == "staging" && $CI_PIPELINE_SOURCE != "merge_request_event"'
|
|
184
230
|
needs:
|
|
@@ -188,28 +234,51 @@ publish:staging:
|
|
|
188
234
|
publish:dev:
|
|
189
235
|
stage: publish
|
|
190
236
|
image: node:24
|
|
191
|
-
|
|
192
|
-
variables:
|
|
193
|
-
NPM_CONFIG_PROVENANCE: "false"
|
|
194
|
-
|
|
195
|
-
id_tokens:
|
|
196
|
-
NPM_ID_TOKEN:
|
|
197
|
-
aud: "npm:registry.npmjs.org"
|
|
198
|
-
|
|
199
|
-
environment:
|
|
200
|
-
name: npm
|
|
201
|
-
url: https://www.npmjs.com/package/datakeen-session-react?activeTab=versions
|
|
202
|
-
|
|
203
237
|
script:
|
|
204
238
|
- git config user.email "ci@datakeen.io"
|
|
205
239
|
- git config user.name "Datakeen CI"
|
|
206
|
-
- git remote set-url origin https://${CI_PUSH_USER}:${CI_PUSH_TOKEN}@gitlab.
|
|
240
|
+
- git remote set-url origin https://${CI_PUSH_USER}:${CI_PUSH_TOKEN}@gitlab.datakeen.co/datakeenteam/teamfullstack/client-sessions-react-sdk.git
|
|
207
241
|
- 'npm version prerelease --preid=dev -m "chore(release): %s"'
|
|
242
|
+
- export TARGET_TAG="v$(node -p "require('./package.json').version")"
|
|
208
243
|
- git push -o ci.skip origin HEAD:dev
|
|
209
244
|
- git push -o ci.skip origin --tags
|
|
210
|
-
- npm
|
|
211
|
-
|
|
245
|
+
- git remote add relay "https://oauth2:${RELAY_API_TOKEN}@gitlab.com/datakeen-ci-relay/npm-publish-relay.git" 2>/dev/null || git remote set-url relay "https://oauth2:${RELAY_API_TOKEN}@gitlab.com/datakeen-ci-relay/npm-publish-relay.git"
|
|
246
|
+
- git checkout --orphan "relay-snapshot-${CI_JOB_ID}"
|
|
247
|
+
- git add -A
|
|
248
|
+
- git commit -m "snapshot for npm publish ${TARGET_TAG}" --quiet
|
|
249
|
+
- git push relay "HEAD:refs/heads/${TARGET_TAG}"
|
|
250
|
+
- |
|
|
251
|
+
set -x
|
|
252
|
+
HTTP_CODE=$(curl -sS -o /tmp/trigger_response.json -w "%{http_code}" -X POST \
|
|
253
|
+
--header "PRIVATE-TOKEN: ${RELAY_API_TOKEN}" \
|
|
254
|
+
--header "Content-Type: application/json" \
|
|
255
|
+
--data "{\"ref\":\"${TARGET_TAG}\"}" \
|
|
256
|
+
"https://gitlab.com/api/v4/projects/${RELAY_PROJECT_ID}/pipeline")
|
|
257
|
+
echo "HTTP status: $HTTP_CODE"
|
|
258
|
+
cat /tmp/trigger_response.json
|
|
259
|
+
if [ "$HTTP_CODE" -ge 400 ]; then
|
|
260
|
+
echo "Echec du trigger, voir la reponse ci-dessus"
|
|
261
|
+
exit 1
|
|
262
|
+
fi
|
|
263
|
+
PIPELINE_ID=$(node -pe "JSON.parse(require('fs').readFileSync('/tmp/trigger_response.json','utf8')).id")
|
|
264
|
+
echo "relay pipeline triggered: $PIPELINE_ID for $TARGET_TAG"
|
|
265
|
+
for i in $(seq 1 60); do
|
|
266
|
+
STATUS_CODE=$(curl -sS -o /tmp/status_response.json -w "%{http_code}" \
|
|
267
|
+
--header "PRIVATE-TOKEN: ${RELAY_API_TOKEN}" \
|
|
268
|
+
"https://gitlab.com/api/v4/projects/${RELAY_PROJECT_ID}/pipelines/${PIPELINE_ID}")
|
|
269
|
+
STATUS=$(node -pe "JSON.parse(require('fs').readFileSync('/tmp/status_response.json','utf8')).status" 2>/dev/null || echo "parse_error")
|
|
270
|
+
echo "poll #$i - http:$STATUS_CODE - pipeline status: $STATUS"
|
|
271
|
+
case "$STATUS" in
|
|
272
|
+
success)
|
|
273
|
+
curl -sS -X DELETE --header "PRIVATE-TOKEN: ${RELAY_API_TOKEN}" "https://gitlab.com/api/v4/projects/${RELAY_PROJECT_ID}/repository/branches/${TARGET_TAG}" > /dev/null || true
|
|
274
|
+
exit 0
|
|
275
|
+
;;
|
|
276
|
+
failed|canceled) echo "publish relais en echec"; cat /tmp/status_response.json; exit 1 ;;
|
|
277
|
+
esac
|
|
278
|
+
sleep 10
|
|
279
|
+
done
|
|
280
|
+
echo "timeout en attendant le relais"; exit 1
|
|
212
281
|
rules:
|
|
213
282
|
- if: '$CI_COMMIT_BRANCH == "dev" && $CI_PIPELINE_SOURCE != "merge_request_event"'
|
|
214
283
|
needs:
|
|
215
|
-
- build
|
|
284
|
+
- build
|
|
@@ -56,13 +56,14 @@ var DocumentCollection = function (_a) {
|
|
|
56
56
|
var _f = React.useState(""), selectedDocumentType = _f[0], setSelectedDocumentType = _f[1];
|
|
57
57
|
var _g = React.useState(null), analysisData = _g[0], setAnalysisData = _g[1];
|
|
58
58
|
var _h = React.useState(null), errorCode = _h[0], setErrorCode = _h[1];
|
|
59
|
-
var _j = React.useState(
|
|
60
|
-
var _k = React.useState(
|
|
61
|
-
var _l = React.useState(
|
|
59
|
+
var _j = React.useState(false), blockContinue = _j[0], setBlockContinue = _j[1];
|
|
60
|
+
var _k = React.useState(null), selectedMethod = _k[0], setSelectedMethod = _k[1];
|
|
61
|
+
var _l = React.useState("before-recto"), photoSubStep = _l[0], setPhotoSubStep = _l[1];
|
|
62
|
+
var _m = React.useState({}), capturedImages = _m[0], setCapturedImages = _m[1];
|
|
62
63
|
// Initialize retry count from session data
|
|
63
|
-
var
|
|
64
|
+
var _o = React.useState(function () {
|
|
64
65
|
return retryService.getNodeRetryCount(session, node.id);
|
|
65
|
-
}), retryCount =
|
|
66
|
+
}), retryCount = _o[0], setRetryCount = _o[1];
|
|
66
67
|
// Update retry count when session loads/changes
|
|
67
68
|
React.useEffect(function () {
|
|
68
69
|
if (session) {
|
|
@@ -170,7 +171,8 @@ var DocumentCollection = function (_a) {
|
|
|
170
171
|
setCurrentStep(4);
|
|
171
172
|
}
|
|
172
173
|
};
|
|
173
|
-
var handleProcessingComplete = function (success, currentRetryCount, apiAnalysisData) {
|
|
174
|
+
var handleProcessingComplete = function (success, currentRetryCount, apiAnalysisData, shouldBlockContinue) {
|
|
175
|
+
setBlockContinue(shouldBlockContinue === true);
|
|
174
176
|
if (apiAnalysisData) {
|
|
175
177
|
setAnalysisData(apiAnalysisData);
|
|
176
178
|
if (apiAnalysisData.length > 0) {
|
|
@@ -224,6 +226,7 @@ var DocumentCollection = function (_a) {
|
|
|
224
226
|
});
|
|
225
227
|
}); };
|
|
226
228
|
var handleRetryFromError = function () {
|
|
229
|
+
setBlockContinue(false);
|
|
227
230
|
setCurrentStep(1);
|
|
228
231
|
setSelectedMethod(null);
|
|
229
232
|
setCapturedImages({});
|
|
@@ -329,7 +332,9 @@ var DocumentCollection = function (_a) {
|
|
|
329
332
|
},
|
|
330
333
|
} }));
|
|
331
334
|
case 6:
|
|
332
|
-
return (jsxRuntime.jsx(DocumentError.default, { documentType: selectedDocumentType, onRetry: handleRetryFromError, onContinueAnyway:
|
|
335
|
+
return (jsxRuntime.jsx(DocumentError.default, { documentType: selectedDocumentType, onRetry: handleRetryFromError, onContinueAnyway: node.allowContinueOnFailure === false
|
|
336
|
+
? undefined
|
|
337
|
+
: handleContinueAnyway, retryCount: retryCount, predictions: analysisData || undefined, errorCode: errorCode || undefined, allowResubmission: allowResubmission, maxResubmissionAttempts: maxResubmissionAttempts, isRetryAllowed: isRetryAllowed(), blockContinue: blockContinue }));
|
|
333
338
|
default:
|
|
334
339
|
console.error("Invalid document collection step: ".concat(currentStep, " "));
|
|
335
340
|
return (jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center h-full p-4 text-center", children: [jsxRuntime.jsx("div", { className: "text-red-500 text-4xl mb-4", children: "\u26A0\uFE0F" }), jsxRuntime.jsx("h2", { className: "text-xl font-bold text-red-600 mb-2", children: t("document_collection.navigation_error.title", "Erreur de navigation") }), jsxRuntime.jsx("p", { className: "text-gray-600 mb-4", children: t("document_collection.navigation_error.description", "Étape non valide. Veuillez recommencer.") }), jsxRuntime.jsx(ButtonDesktop.default, { type: "back", className: "w-full", onClick: function () { return setCurrentStep(0); }, children: t("document_collection.navigation_error.back", "Retour au début") })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentCollection.js","sources":["../../../../../src/components/document-collection/DocumentCollection.tsx"],"sourcesContent":["import { useState, useEffect } from \"react\";\nimport {\n SessionTemplate,\n SessionTemplateNode,\n stepObject,\n} from \"../../types/session\";\nimport type { onUploadFiles } from \"../../types/uploadFiles\";\nimport type { Prediction } from \"../../utils/apiAnalysis\";\nimport DocumentCollectionIntroduction from \"./DocumentCollectionIntroduction\";\nimport DocumentCollectionSelection from \"./DocumentCollectionSelection\";\nimport DocumentCollectionUpload from \"./DocumentCollectionUpload\";\nimport DocumentCollectionMethodSelection from \"./DocumentCollectionMethodSelection\";\nimport { DocumentError, DocumentProcessing, DocumentSuccess } from \".\";\nimport JDIProcessing from \"../jdi/JDIProcessing\";\nimport JDISuccess from \"../jdi/JDISuccess\";\nimport JDIError from \"../jdi/JDIError\";\nimport BeforePhoto from \"../id-check/BeforePhoto\";\nimport BeforeVersoPhoto from \"../id-check/BeforeVersoPhoto\";\nimport Photo from \"../id-check/Photo\";\nimport PhotoPreview from \"../id-check/PhotoPreview\";\nimport PhotoConfirmation from \"../id-check/PhotoConfirmation\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport ButtonDesktop from \"../ui/ButtonDesktop\";\nimport { updateSessionCurrentStep } from \"../../services/sessionService\";\nimport { analyzeFiles } from \"../../services/analysis\";\nimport {\n getNodeRetryCount,\n incrementNodeRetryCount,\n} from \"../../services/retryService\";\nimport { getSession } from \"../../context/SessionContext\";\nimport {\n resizeAfterCapture,\n dataUrlToBlob,\n blobToDataUrl,\n} from \"../../utils/imageProcessing\";\n\nexport type DocumentTypeSide = \"ONE_FILE\" | \"RECTO_VERSO\";\n\nexport interface NodeDocumentCollection {\n id: string;\n allowedDocumentTypes: Array<{\n name: string;\n id: string;\n collectOnly?: boolean;\n }>;\n allowedAddingMethods: Array<'download' | 'picture'>;\n introductionPage: {\n title: string;\n description: string;\n };\n documentSelection: {\n title: string;\n description: string;\n };\n allowResubmission: boolean;\n maxResubmissionAttempts?: number;\n}\n\ninterface AllowedDocumentType {\n id: string;\n name: string;\n side?: DocumentTypeSide;\n collectOnly?: boolean;\n}\n\ninterface DocumentCollectionProps {\n stepObject: stepObject;\n sessionId: string;\n node: NodeDocumentCollection;\n onContinueOnPC?: () => void;\n allowedDocumentTypes: AllowedDocumentType[];\n allowedAddingMethods: string[];\n template?: SessionTemplate;\n introductionPage?: {\n title?: string;\n description?: string;\n };\n documentSelection?: {\n title?: string;\n description?: string;\n };\n allowResubmission?: boolean;\n maxResubmissionAttempts?: number;\n}\n\n/**\n * DocumentCollection component manages the multi-step document collection flow.\n * It handles document type selection, document upload, processing, and error/success handling.\n *\n * @component\n * @param {Object} props - Component props.\n * @param {stepObject} props.stepObject - Object managing the current step in the parent flow, with setStep and step properties.\n * @param {string} props.sessionId - Unique identifier for the current session.\n * @param {NodeDocumentCollection} props.node - Node configuration containing allowed document types and page content.\n * @param {() => void} [props.onContinueOnPC] - Optional callback to continue the process on a PC.\n * @param {AllowedDocumentType[]} props.allowedDocumentTypes - List of document types accepted for collection.\n * @param {string[]} props.allowedAddingMethods - List of allowed methods for adding documents (download, picture, etc.).\n * @param {Object} [props.introductionPage] - Optional introduction page configuration with title and description.\n * @param {Object} [props.documentSelection] - Optional document selection page configuration with title and description.\n *\n * @returns {JSX.Element} Multi-step document collection UI, rendering different subcomponents based on the current step.\n *\n * @remarks\n * - Manages internal state for step navigation, document selection, file uploads, and error handling.\n * - Displays error messages and fallback UI for invalid navigation.\n * - Uses translation hooks for internationalization support.\n */\nconst DocumentCollection = ({\n stepObject,\n sessionId,\n node,\n template,\n onContinueOnPC,\n allowedDocumentTypes,\n allowedAddingMethods,\n introductionPage,\n documentSelection,\n allowResubmission,\n maxResubmissionAttempts,\n}: DocumentCollectionProps) => {\n const { t } = useI18n();\n const { session } = getSession();\n\n const [currentStep, setCurrentStep] = useState(introductionPage?.title ? 0 : 1);\n const [fileUploaded, setFileUploaded] = useState<onUploadFiles | null>(null);\n const [selectedDocumentType, setSelectedDocumentType] = useState<string>(\"\");\n const [analysisData, setAnalysisData] = useState<Prediction[] | null>(null);\n const [errorCode, setErrorCode] = useState<string | null>(null);\n const [selectedMethod, setSelectedMethod] = useState<\"download\" | \"picture\" | null>(null);\n const [photoSubStep, setPhotoSubStep] = useState<\"before-recto\" | \"recto\" | \"preview-recto\" | \"before-verso\" | \"verso\" | \"preview-verso\" | \"confirmation\">(\"before-recto\");\n const [capturedImages, setCapturedImages] = useState<Record<string, string>>({});\n\n // Initialize retry count from session data\n const [retryCount, setRetryCount] = useState(() => {\n return getNodeRetryCount(session, node.id);\n });\n\n // Update retry count when session loads/changes\n useEffect(() => {\n if (session) {\n const sessionRetryCount = getNodeRetryCount(session, node.id);\n setRetryCount(sessionRetryCount);\n }\n }, [session, node.id]);\n\n // Check retry limits on mount/reload - if retries exhausted, show error page\n useEffect(() => {\n // Special case: if allowResubmission is false and retryCount > 0, show error immediately\n if (allowResubmission === false && retryCount > 0) {\n setCurrentStep(6);\n return;\n }\n\n // Normal case: check against maxResubmissionAttempts\n if (retryCount > 0 && !isRetryAllowed()) {\n // User has exhausted retries, redirect to error page\n setCurrentStep(6);\n }\n }, [retryCount, allowResubmission]);\n\n const handleContinueFromIntroduction = () => {\n setCurrentStep(1);\n };\n\n const handleDocumentTypeSelect = (docType: string, files?: onUploadFiles) => {\n setSelectedDocumentType(docType);\n\n if (files) {\n handleDocumentUpload(files);\n return;\n }\n\n const isPictureAllowed = allowedAddingMethods.includes(\"picture\");\n const isDownloadAllowed = allowedAddingMethods.includes(\"download\");\n\n if (isPictureAllowed && isDownloadAllowed) {\n setCurrentStep(2); // Method selection\n } else {\n const method = isPictureAllowed ? \"picture\" : \"download\";\n handleMethodSelect(method);\n }\n };\n\n const handleMethodSelect = (method: \"download\" | \"picture\") => {\n setSelectedMethod(method);\n if (method === \"picture\") {\n setPhotoSubStep(\"before-recto\");\n setCapturedImages({});\n }\n setCurrentStep(3); // Go to action (Upload screen or Photo flow)\n };\n\n const handlePhotoCapture = async (imageData: string, side: \"recto\" | \"verso\") => {\n try {\n const imageBlob = dataUrlToBlob(imageData);\n const processedBlob = await resizeAfterCapture(imageBlob);\n const processedDataUrl = await blobToDataUrl(processedBlob);\n setCapturedImages((prev) => ({ ...prev, [side]: processedDataUrl }));\n } catch (error) {\n console.error(`[DocumentCollection] Failed to process photo for ${side}:`, error);\n setCapturedImages((prev) => ({ ...prev, [side]: imageData }));\n }\n setPhotoSubStep(side === \"recto\" ? \"preview-recto\" : \"preview-verso\");\n };\n\n const handlePhotoConfirmation = () => {\n if (capturedImages.recto) {\n const files: onUploadFiles = {\n front: capturedImages.recto,\n back: capturedImages.verso || null,\n };\n setFileUploaded(files);\n setCurrentStep(4);\n }\n };\n\n const handleDocumentUpload = (files: onUploadFiles) => {\n setFileUploaded(files);\n\n // Check if the selected document type is collectOnly — skip processing step\n const selectedDoc = allowedDocumentTypes.find((d) => d.id === selectedDocumentType);\n if (selectedDoc?.collectOnly) {\n handleCollectOnlyUpload(files);\n return;\n }\n\n // Check if retry limit is reached before processing\n if (!isRetryAllowed() && retryCount > 0) {\n // Skip processing and go directly to error page\n setCurrentStep(6);\n } else {\n // Proceed to processing\n setCurrentStep(4);\n }\n };\n\n const handleProcessingComplete = (\n success: boolean,\n currentRetryCount?: number,\n apiAnalysisData?: Prediction[] | null\n ) => {\n if (apiAnalysisData) {\n setAnalysisData(apiAnalysisData);\n if (apiAnalysisData.length > 0) {\n setErrorCode(apiAnalysisData[0].code);\n }\n }\n\n if (success) {\n // Always follow the graph edges. Arithmetic fallback only when no template is available\n // (out of the normal TemplateNodeRenderer flow).\n if (template) {\n stepObject.goToNextStep(node.id, template);\n } else {\n stepObject.setStep(stepObject.step + 1);\n }\n setCurrentStep(5);\n } else {\n setRetryCount((prev) => {\n const newCount = prev + 1;\n incrementNodeRetryCount(sessionId, node.id, prev).catch((error) => {\n console.error(\"Failed to update retry count in session:\", error);\n });\n return newCount;\n });\n setCurrentStep(6);\n }\n };\n\n const handleCollectOnlyUpload = async (files: onUploadFiles) => {\n try {\n await analyzeFiles(sessionId, node.id, files, selectedDocumentType, {\n documentTypeKey: selectedDocumentType,\n collectOnly: true,\n enablePolling: false,\n });\n handleProcessingComplete(true, retryCount, null);\n } catch (error) {\n console.error(\"[DocumentCollection] collectOnly upload failed:\", error);\n handleProcessingComplete(false, retryCount, null);\n }\n };\n\n const handleRetryFromError = () => {\n setCurrentStep(1);\n setSelectedMethod(null);\n setCapturedImages({});\n setFileUploaded(null);\n };\n\n // Check if retry is allowed based on configuration\n const isRetryAllowed = () => {\n if (allowResubmission === undefined) return true;\n if (!allowResubmission) return false;\n if (maxResubmissionAttempts !== undefined) {\n return retryCount <= maxResubmissionAttempts;\n }\n return true;\n };\n\n // Node progression must follow the graph edges. `onContinueOnPC` is reserved for the\n // QR / mobile→PC redirection and must NOT drive node progression (it navigates by raw step\n // arithmetic, which breaks when several nodes share the same `order`).\n const handleContinueAnyway = () => {\n if (template) {\n stepObject.goToNextStep(node.id, template);\n } else if (onContinueOnPC) {\n onContinueOnPC();\n } else {\n stepObject.setStep(stepObject.step + 1);\n }\n };\n\n const handleSuccessContinue = () => {\n if (template) {\n stepObject.goToNextStep(node.id, template);\n } else if (onContinueOnPC) {\n onContinueOnPC();\n } else {\n stepObject.setStep(stepObject.step + 1);\n }\n };\n\n const handleBack = () => {\n if (currentStep === 0) {\n // Inter-node back navigation goes through the history-aware goBack(), never raw arithmetic.\n stepObject.goBack();\n } else {\n setCurrentStep(currentStep - 1);\n }\n };\n\n switch (currentStep) {\n case 0:\n return (\n <DocumentCollectionIntroduction\n onContinue={handleContinueFromIntroduction}\n onBack={handleBack}\n introductionPage={introductionPage}\n />\n );\n case 1:\n return (\n <DocumentCollectionSelection\n onContinue={handleDocumentTypeSelect}\n onBack={handleBack}\n allowedDocumentTypes={allowedDocumentTypes}\n allowedAddingMethods={allowedAddingMethods}\n stepObject={stepObject}\n documentSelection={documentSelection}\n />\n );\n case 2:\n return (\n <DocumentCollectionMethodSelection\n onMethodSelect={handleMethodSelect}\n onBack={handleBack}\n title={documentSelection?.title}\n description={documentSelection?.description}\n />\n );\n case 3:\n if (selectedMethod === \"download\") {\n return (\n <DocumentCollectionUpload\n selectedDocumentType={selectedDocumentType}\n allowedDocumentTypes={allowedDocumentTypes}\n onUpload={handleDocumentUpload}\n onBack={handleBack}\n documentSelection={documentSelection}\n sessionId={sessionId}\n />\n );\n } else {\n // Photo flow\n const requiresTwoSides = allowedDocumentTypes.find((dt) => dt.id === selectedDocumentType)?.side === \"RECTO_VERSO\";\n\n switch (photoSubStep) {\n case \"before-recto\":\n return <BeforePhoto setStep={() => setPhotoSubStep(\"recto\")} isSingleSided={!requiresTwoSides} onBack={handleBack} />;\n case \"recto\":\n return <Photo onCapture={(img) => handlePhotoCapture(img, \"recto\")} automaticCapture={false} maskType=\"document\" />;\n case \"preview-recto\":\n return (\n <PhotoPreview\n imageUrl={capturedImages.recto}\n side=\"recto\"\n isSingleSided={!requiresTwoSides}\n onValidate={() => setPhotoSubStep(requiresTwoSides ? \"before-verso\" : \"confirmation\")}\n onRetake={() => {\n setCapturedImages((prev) => { const next = { ...prev }; delete next.recto; return next; });\n setPhotoSubStep(\"recto\");\n }}\n />\n );\n case \"before-verso\":\n return <BeforeVersoPhoto setStep={() => setPhotoSubStep(\"verso\")} />;\n case \"verso\":\n return <Photo onCapture={(img) => handlePhotoCapture(img, \"verso\")} automaticCapture={false} maskType=\"document\" />;\n case \"preview-verso\":\n return (\n <PhotoPreview\n imageUrl={capturedImages.verso}\n side=\"verso\"\n onValidate={() => setPhotoSubStep(\"confirmation\")}\n onRetake={() => {\n setCapturedImages((prev) => { const next = { ...prev }; delete next.verso; return next; });\n setPhotoSubStep(\"verso\");\n }}\n />\n );\n case \"confirmation\":\n return (\n <PhotoConfirmation\n imageUrl={capturedImages.recto}\n versoImageUrl={capturedImages.verso}\n requiresTwoSides={requiresTwoSides}\n onConfirm={handlePhotoConfirmation}\n onRetry={() => {\n setPhotoSubStep(\"before-recto\");\n setCapturedImages({});\n }}\n onRetryAfterProcessing={() => {\n setCurrentStep(1);\n setPhotoSubStep(\"before-recto\");\n setCapturedImages({});\n }}\n fileUploaded={fileUploaded}\n isSingleSided={!requiresTwoSides}\n />\n );\n }\n }\n return null;\n\n case 4:\n return (\n <DocumentProcessing\n documentType={selectedDocumentType}\n onProcessingComplete={handleProcessingComplete}\n fileUploaded={fileUploaded}\n documentTypeId={selectedDocumentType}\n retryCount={retryCount}\n nodeId={node.id}\n />\n );\n case 5:\n return (\n <DocumentSuccess\n documentType={selectedDocumentType}\n documentTypeLabel={t(allowedDocumentTypes.find((dt) => dt.id === selectedDocumentType)?.name || \"\")}\n onContinue={handleSuccessContinue}\n errorCode={errorCode || undefined}\n successDetails={{\n nextSteps: {\n title: t(\"success.next_steps\", \"Prochaines étapes\"),\n description: t(\n \"success.next_steps_description\",\n \"Vous pouvez maintenant continuer le processus de vérification en suivant les instructions à l'écran.\"\n ),\n },\n }}\n />\n );\n case 6:\n return (\n <DocumentError\n documentType={selectedDocumentType}\n onRetry={handleRetryFromError}\n onContinueAnyway={handleContinueAnyway}\n retryCount={retryCount}\n predictions={analysisData || undefined}\n errorCode={errorCode || undefined}\n allowResubmission={allowResubmission}\n maxResubmissionAttempts={maxResubmissionAttempts}\n isRetryAllowed={isRetryAllowed()}\n />\n );\n\n default:\n console.error(`Invalid document collection step: ${currentStep} `);\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-red-500 text-4xl mb-4\">⚠️</div>\n <h2 className=\"text-xl font-bold text-red-600 mb-2\">\n {t(\"document_collection.navigation_error.title\", \"Erreur de navigation\")}\n </h2>\n <p className=\"text-gray-600 mb-4\">\n {t(\"document_collection.navigation_error.description\", \"Étape non valide. Veuillez recommencer.\")}\n </p>\n <ButtonDesktop\n type=\"back\"\n className=\"w-full\"\n onClick={() => setCurrentStep(0)}\n >\n {t(\"document_collection.navigation_error.back\", \"Retour au début\")}\n </ButtonDesktop>\n </div>\n );\n }\n};\n\nexport default DocumentCollection;\n"],"names":["useI18n","getSession","useState","getNodeRetryCount","useEffect","__awaiter","dataUrlToBlob","resizeAfterCapture","blobToDataUrl","incrementNodeRetryCount","analyzeFiles","_jsx","DocumentCollectionIntroduction","DocumentCollectionSelection","DocumentCollectionMethodSelection","DocumentCollectionUpload","BeforePhoto","Photo","PhotoPreview","__assign","BeforeVersoPhoto","PhotoConfirmation","DocumentProcessing","DocumentSuccess","DocumentError","_jsxs","ButtonDesktop"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAqFA;;;;;;;;;;;;;;;;;;;;;AAqBG;AACH,IAAM,kBAAkB,GAAG,UAAC,EAYF,EAAA;;AAXxB,IAAA,IAAA,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,IAAI,GAAA,EAAA,CAAA,IAAA,EACJ,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,cAAc,oBAAA,EACd,oBAAoB,GAAA,EAAA,CAAA,oBAAA,EACpB,oBAAoB,GAAA,EAAA,CAAA,oBAAA,EACpB,gBAAgB,GAAA,EAAA,CAAA,gBAAA,EAChB,iBAAiB,GAAA,EAAA,CAAA,iBAAA,EACjB,iBAAiB,GAAA,EAAA,CAAA,i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c,EAAE,EAAA,CAChC;AAGN,QAAA;AACE,YAAA,OAAO,CAAC,KAAK,CAAC,4CAAqC,WAAW,EAAA,GAAA,CAAG,CAAC;AAClE,YAAA,QACEC,eAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,kEAAkE,EAAA,QAAA,EAAA,CAC/Ed,cAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,4BAA4B,EAAA,QAAA,EAAA,cAAA,EAAA,CAAS,EACpDA,cAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,qCAAqC,EAAA,QAAA,EAChD,CAAC,CAAC,4CAA4C,EAAE,sBAAsB,CAAC,EAAA,CACrE,EACLA,cAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,oBAAoB,EAAA,QAAA,EAC9B,CAAC,CAAC,kDAAkD,EAAE,yCAAyC,CAAC,EAAA,CAC/F,EACJA,cAAA,CAACe,qBAAa,IACZ,IAAI,EAAC,MAAM,EACX,SAAS,EAAC,QAAQ,EAClB,OAAO,EAAE,YAAA,EAAM,OAAA,cAAc,CAAC,CAAC,CAAC,CAAA,CAAjB,CAAiB,EAAA,QAAA,EAE/B,CAAC,CAAC,2CAA2C,EAAE,iBAAiB,CAAC,EAAA,CACpD,CAAA,EAAA,CACZ;;AAGd;;;;"}
|
|
1
|
+
{"version":3,"file":"DocumentCollection.js","sources":["../../../../../src/components/document-collection/DocumentCollection.tsx"],"sourcesContent":["import { useState, useEffect } from \"react\";\nimport {\n SessionTemplate,\n SessionTemplateNode,\n stepObject,\n} from \"../../types/session\";\nimport type { onUploadFiles } from \"../../types/uploadFiles\";\nimport type { Prediction } from \"../../utils/apiAnalysis\";\nimport DocumentCollectionIntroduction from \"./DocumentCollectionIntroduction\";\nimport DocumentCollectionSelection from \"./DocumentCollectionSelection\";\nimport DocumentCollectionUpload from \"./DocumentCollectionUpload\";\nimport DocumentCollectionMethodSelection from \"./DocumentCollectionMethodSelection\";\nimport { DocumentError, DocumentProcessing, DocumentSuccess } from \".\";\nimport JDIProcessing from \"../jdi/JDIProcessing\";\nimport JDISuccess from \"../jdi/JDISuccess\";\nimport JDIError from \"../jdi/JDIError\";\nimport BeforePhoto from \"../id-check/BeforePhoto\";\nimport BeforeVersoPhoto from \"../id-check/BeforeVersoPhoto\";\nimport Photo from \"../id-check/Photo\";\nimport PhotoPreview from \"../id-check/PhotoPreview\";\nimport PhotoConfirmation from \"../id-check/PhotoConfirmation\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport ButtonDesktop from \"../ui/ButtonDesktop\";\nimport { updateSessionCurrentStep } from \"../../services/sessionService\";\nimport { analyzeFiles } from \"../../services/analysis\";\nimport {\n getNodeRetryCount,\n incrementNodeRetryCount,\n} from \"../../services/retryService\";\nimport { getSession } from \"../../context/SessionContext\";\nimport {\n resizeAfterCapture,\n dataUrlToBlob,\n blobToDataUrl,\n} from \"../../utils/imageProcessing\";\n\nexport type DocumentTypeSide = \"ONE_FILE\" | \"RECTO_VERSO\";\n\nexport interface NodeDocumentCollection {\n id: string;\n allowedDocumentTypes: Array<{\n name: string;\n id: string;\n collectOnly?: boolean;\n }>;\n allowedAddingMethods: Array<'download' | 'picture'>;\n introductionPage: {\n title: string;\n description: string;\n };\n documentSelection: {\n title: string;\n description: string;\n };\n allowResubmission: boolean;\n maxResubmissionAttempts?: number;\n /** Paramétrable par nœud dans le journey builder. Absent/true = comportement\n * actuel inchangé (bouton \"Continuer quand même\" proposé) ; false = masqué. */\n allowContinueOnFailure?: boolean;\n}\n\ninterface AllowedDocumentType {\n id: string;\n name: string;\n side?: DocumentTypeSide;\n collectOnly?: boolean;\n}\n\ninterface DocumentCollectionProps {\n stepObject: stepObject;\n sessionId: string;\n node: NodeDocumentCollection;\n onContinueOnPC?: () => void;\n allowedDocumentTypes: AllowedDocumentType[];\n allowedAddingMethods: string[];\n template?: SessionTemplate;\n introductionPage?: {\n title?: string;\n description?: string;\n };\n documentSelection?: {\n title?: string;\n description?: string;\n };\n allowResubmission?: boolean;\n maxResubmissionAttempts?: number;\n}\n\n/**\n * DocumentCollection component manages the multi-step document collection flow.\n * It handles document type selection, document upload, processing, and error/success handling.\n *\n * @component\n * @param {Object} props - Component props.\n * @param {stepObject} props.stepObject - Object managing the current step in the parent flow, with setStep and step properties.\n * @param {string} props.sessionId - Unique identifier for the current session.\n * @param {NodeDocumentCollection} props.node - Node configuration containing allowed document types and page content.\n * @param {() => void} [props.onContinueOnPC] - Optional callback to continue the process on a PC.\n * @param {AllowedDocumentType[]} props.allowedDocumentTypes - List of document types accepted for collection.\n * @param {string[]} props.allowedAddingMethods - List of allowed methods for adding documents (download, picture, etc.).\n * @param {Object} [props.introductionPage] - Optional introduction page configuration with title and description.\n * @param {Object} [props.documentSelection] - Optional document selection page configuration with title and description.\n *\n * @returns {JSX.Element} Multi-step document collection UI, rendering different subcomponents based on the current step.\n *\n * @remarks\n * - Manages internal state for step navigation, document selection, file uploads, and error handling.\n * - Displays error messages and fallback UI for invalid navigation.\n * - Uses translation hooks for internationalization support.\n */\nconst DocumentCollection = ({\n stepObject,\n sessionId,\n node,\n template,\n onContinueOnPC,\n allowedDocumentTypes,\n allowedAddingMethods,\n introductionPage,\n documentSelection,\n allowResubmission,\n maxResubmissionAttempts,\n}: DocumentCollectionProps) => {\n const { t } = useI18n();\n const { session } = getSession();\n\n const [currentStep, setCurrentStep] = useState(introductionPage?.title ? 0 : 1);\n const [fileUploaded, setFileUploaded] = useState<onUploadFiles | null>(null);\n const [selectedDocumentType, setSelectedDocumentType] = useState<string>(\"\");\n const [analysisData, setAnalysisData] = useState<Prediction[] | null>(null);\n const [errorCode, setErrorCode] = useState<string | null>(null);\n const [blockContinue, setBlockContinue] = useState(false);\n const [selectedMethod, setSelectedMethod] = useState<\"download\" | \"picture\" | null>(null);\n const [photoSubStep, setPhotoSubStep] = useState<\"before-recto\" | \"recto\" | \"preview-recto\" | \"before-verso\" | \"verso\" | \"preview-verso\" | \"confirmation\">(\"before-recto\");\n const [capturedImages, setCapturedImages] = useState<Record<string, string>>({});\n\n // Initialize retry count from session data\n const [retryCount, setRetryCount] = useState(() => {\n return getNodeRetryCount(session, node.id);\n });\n\n // Update retry count when session loads/changes\n useEffect(() => {\n if (session) {\n const sessionRetryCount = getNodeRetryCount(session, node.id);\n setRetryCount(sessionRetryCount);\n }\n }, [session, node.id]);\n\n // Check retry limits on mount/reload - if retries exhausted, show error page\n useEffect(() => {\n // Special case: if allowResubmission is false and retryCount > 0, show error immediately\n if (allowResubmission === false && retryCount > 0) {\n setCurrentStep(6);\n return;\n }\n\n // Normal case: check against maxResubmissionAttempts\n if (retryCount > 0 && !isRetryAllowed()) {\n // User has exhausted retries, redirect to error page\n setCurrentStep(6);\n }\n }, [retryCount, allowResubmission]);\n\n const handleContinueFromIntroduction = () => {\n setCurrentStep(1);\n };\n\n const handleDocumentTypeSelect = (docType: string, files?: onUploadFiles) => {\n setSelectedDocumentType(docType);\n\n if (files) {\n handleDocumentUpload(files);\n return;\n }\n\n const isPictureAllowed = allowedAddingMethods.includes(\"picture\");\n const isDownloadAllowed = allowedAddingMethods.includes(\"download\");\n\n if (isPictureAllowed && isDownloadAllowed) {\n setCurrentStep(2); // Method selection\n } else {\n const method = isPictureAllowed ? \"picture\" : \"download\";\n handleMethodSelect(method);\n }\n };\n\n const handleMethodSelect = (method: \"download\" | \"picture\") => {\n setSelectedMethod(method);\n if (method === \"picture\") {\n setPhotoSubStep(\"before-recto\");\n setCapturedImages({});\n }\n setCurrentStep(3); // Go to action (Upload screen or Photo flow)\n };\n\n const handlePhotoCapture = async (imageData: string, side: \"recto\" | \"verso\") => {\n try {\n const imageBlob = dataUrlToBlob(imageData);\n const processedBlob = await resizeAfterCapture(imageBlob);\n const processedDataUrl = await blobToDataUrl(processedBlob);\n setCapturedImages((prev) => ({ ...prev, [side]: processedDataUrl }));\n } catch (error) {\n console.error(`[DocumentCollection] Failed to process photo for ${side}:`, error);\n setCapturedImages((prev) => ({ ...prev, [side]: imageData }));\n }\n setPhotoSubStep(side === \"recto\" ? \"preview-recto\" : \"preview-verso\");\n };\n\n const handlePhotoConfirmation = () => {\n if (capturedImages.recto) {\n const files: onUploadFiles = {\n front: capturedImages.recto,\n back: capturedImages.verso || null,\n };\n setFileUploaded(files);\n setCurrentStep(4);\n }\n };\n\n const handleDocumentUpload = (files: onUploadFiles) => {\n setFileUploaded(files);\n\n // Check if the selected document type is collectOnly — skip processing step\n const selectedDoc = allowedDocumentTypes.find((d) => d.id === selectedDocumentType);\n if (selectedDoc?.collectOnly) {\n handleCollectOnlyUpload(files);\n return;\n }\n\n // Check if retry limit is reached before processing\n if (!isRetryAllowed() && retryCount > 0) {\n // Skip processing and go directly to error page\n setCurrentStep(6);\n } else {\n // Proceed to processing\n setCurrentStep(4);\n }\n };\n\n const handleProcessingComplete = (\n success: boolean,\n currentRetryCount?: number,\n apiAnalysisData?: Prediction[] | null,\n shouldBlockContinue?: boolean,\n ) => {\n setBlockContinue(shouldBlockContinue === true);\n if (apiAnalysisData) {\n setAnalysisData(apiAnalysisData);\n if (apiAnalysisData.length > 0) {\n setErrorCode(apiAnalysisData[0].code);\n }\n }\n\n if (success) {\n // Always follow the graph edges. Arithmetic fallback only when no template is available\n // (out of the normal TemplateNodeRenderer flow).\n if (template) {\n stepObject.goToNextStep(node.id, template);\n } else {\n stepObject.setStep(stepObject.step + 1);\n }\n setCurrentStep(5);\n } else {\n setRetryCount((prev) => {\n const newCount = prev + 1;\n incrementNodeRetryCount(sessionId, node.id, prev).catch((error) => {\n console.error(\"Failed to update retry count in session:\", error);\n });\n return newCount;\n });\n setCurrentStep(6);\n }\n };\n\n const handleCollectOnlyUpload = async (files: onUploadFiles) => {\n try {\n await analyzeFiles(sessionId, node.id, files, selectedDocumentType, {\n documentTypeKey: selectedDocumentType,\n collectOnly: true,\n enablePolling: false,\n });\n handleProcessingComplete(true, retryCount, null);\n } catch (error) {\n console.error(\"[DocumentCollection] collectOnly upload failed:\", error);\n handleProcessingComplete(false, retryCount, null);\n }\n };\n\n const handleRetryFromError = () => {\n setBlockContinue(false);\n setCurrentStep(1);\n setSelectedMethod(null);\n setCapturedImages({});\n setFileUploaded(null);\n };\n\n // Check if retry is allowed based on configuration\n const isRetryAllowed = () => {\n if (allowResubmission === undefined) return true;\n if (!allowResubmission) return false;\n if (maxResubmissionAttempts !== undefined) {\n return retryCount <= maxResubmissionAttempts;\n }\n return true;\n };\n\n // Node progression must follow the graph edges. `onContinueOnPC` is reserved for the\n // QR / mobile→PC redirection and must NOT drive node progression (it navigates by raw step\n // arithmetic, which breaks when several nodes share the same `order`).\n const handleContinueAnyway = () => {\n if (template) {\n stepObject.goToNextStep(node.id, template);\n } else if (onContinueOnPC) {\n onContinueOnPC();\n } else {\n stepObject.setStep(stepObject.step + 1);\n }\n };\n\n const handleSuccessContinue = () => {\n if (template) {\n stepObject.goToNextStep(node.id, template);\n } else if (onContinueOnPC) {\n onContinueOnPC();\n } else {\n stepObject.setStep(stepObject.step + 1);\n }\n };\n\n const handleBack = () => {\n if (currentStep === 0) {\n // Inter-node back navigation goes through the history-aware goBack(), never raw arithmetic.\n stepObject.goBack();\n } else {\n setCurrentStep(currentStep - 1);\n }\n };\n\n switch (currentStep) {\n case 0:\n return (\n <DocumentCollectionIntroduction\n onContinue={handleContinueFromIntroduction}\n onBack={handleBack}\n introductionPage={introductionPage}\n />\n );\n case 1:\n return (\n <DocumentCollectionSelection\n onContinue={handleDocumentTypeSelect}\n onBack={handleBack}\n allowedDocumentTypes={allowedDocumentTypes}\n allowedAddingMethods={allowedAddingMethods}\n stepObject={stepObject}\n documentSelection={documentSelection}\n />\n );\n case 2:\n return (\n <DocumentCollectionMethodSelection\n onMethodSelect={handleMethodSelect}\n onBack={handleBack}\n title={documentSelection?.title}\n description={documentSelection?.description}\n />\n );\n case 3:\n if (selectedMethod === \"download\") {\n return (\n <DocumentCollectionUpload\n selectedDocumentType={selectedDocumentType}\n allowedDocumentTypes={allowedDocumentTypes}\n onUpload={handleDocumentUpload}\n onBack={handleBack}\n documentSelection={documentSelection}\n sessionId={sessionId}\n />\n );\n } else {\n // Photo flow\n const requiresTwoSides = allowedDocumentTypes.find((dt) => dt.id === selectedDocumentType)?.side === \"RECTO_VERSO\";\n\n switch (photoSubStep) {\n case \"before-recto\":\n return <BeforePhoto setStep={() => setPhotoSubStep(\"recto\")} isSingleSided={!requiresTwoSides} onBack={handleBack} />;\n case \"recto\":\n return <Photo onCapture={(img) => handlePhotoCapture(img, \"recto\")} automaticCapture={false} maskType=\"document\" />;\n case \"preview-recto\":\n return (\n <PhotoPreview\n imageUrl={capturedImages.recto}\n side=\"recto\"\n isSingleSided={!requiresTwoSides}\n onValidate={() => setPhotoSubStep(requiresTwoSides ? \"before-verso\" : \"confirmation\")}\n onRetake={() => {\n setCapturedImages((prev) => { const next = { ...prev }; delete next.recto; return next; });\n setPhotoSubStep(\"recto\");\n }}\n />\n );\n case \"before-verso\":\n return <BeforeVersoPhoto setStep={() => setPhotoSubStep(\"verso\")} />;\n case \"verso\":\n return <Photo onCapture={(img) => handlePhotoCapture(img, \"verso\")} automaticCapture={false} maskType=\"document\" />;\n case \"preview-verso\":\n return (\n <PhotoPreview\n imageUrl={capturedImages.verso}\n side=\"verso\"\n onValidate={() => setPhotoSubStep(\"confirmation\")}\n onRetake={() => {\n setCapturedImages((prev) => { const next = { ...prev }; delete next.verso; return next; });\n setPhotoSubStep(\"verso\");\n }}\n />\n );\n case \"confirmation\":\n return (\n <PhotoConfirmation\n imageUrl={capturedImages.recto}\n versoImageUrl={capturedImages.verso}\n requiresTwoSides={requiresTwoSides}\n onConfirm={handlePhotoConfirmation}\n onRetry={() => {\n setPhotoSubStep(\"before-recto\");\n setCapturedImages({});\n }}\n onRetryAfterProcessing={() => {\n setCurrentStep(1);\n setPhotoSubStep(\"before-recto\");\n setCapturedImages({});\n }}\n fileUploaded={fileUploaded}\n isSingleSided={!requiresTwoSides}\n />\n );\n }\n }\n return null;\n\n case 4:\n return (\n <DocumentProcessing\n documentType={selectedDocumentType}\n onProcessingComplete={handleProcessingComplete}\n fileUploaded={fileUploaded}\n documentTypeId={selectedDocumentType}\n retryCount={retryCount}\n nodeId={node.id}\n />\n );\n case 5:\n return (\n <DocumentSuccess\n documentType={selectedDocumentType}\n documentTypeLabel={t(allowedDocumentTypes.find((dt) => dt.id === selectedDocumentType)?.name || \"\")}\n onContinue={handleSuccessContinue}\n errorCode={errorCode || undefined}\n successDetails={{\n nextSteps: {\n title: t(\"success.next_steps\", \"Prochaines étapes\"),\n description: t(\n \"success.next_steps_description\",\n \"Vous pouvez maintenant continuer le processus de vérification en suivant les instructions à l'écran.\"\n ),\n },\n }}\n />\n );\n case 6:\n return (\n <DocumentError\n documentType={selectedDocumentType}\n onRetry={handleRetryFromError}\n onContinueAnyway={\n node.allowContinueOnFailure === false\n ? undefined\n : handleContinueAnyway\n }\n retryCount={retryCount}\n predictions={analysisData || undefined}\n errorCode={errorCode || undefined}\n allowResubmission={allowResubmission}\n maxResubmissionAttempts={maxResubmissionAttempts}\n isRetryAllowed={isRetryAllowed()}\n blockContinue={blockContinue}\n />\n );\n\n default:\n console.error(`Invalid document collection step: ${currentStep} `);\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 text-center\">\n <div className=\"text-red-500 text-4xl mb-4\">⚠️</div>\n <h2 className=\"text-xl font-bold text-red-600 mb-2\">\n {t(\"document_collection.navigation_error.title\", \"Erreur de navigation\")}\n </h2>\n <p className=\"text-gray-600 mb-4\">\n {t(\"document_collection.navigation_error.description\", \"Étape non valide. Veuillez recommencer.\")}\n </p>\n <ButtonDesktop\n type=\"back\"\n className=\"w-full\"\n onClick={() => setCurrentStep(0)}\n >\n {t(\"document_collection.navigation_error.back\", \"Retour au début\")}\n </ButtonDesktop>\n </div>\n );\n }\n};\n\nexport default DocumentCollection;\n"],"names":["useI18n","getSession","useState","getNodeRetryCount","useEffect","__awaiter","dataUrlToBlob","resizeAfterCapture","blobToDataUrl","incrementNodeRetryCount","analyzeFiles","_jsx","DocumentCollectionIntroduction","DocumentCollectionSelection","DocumentCollectionMethodSelection","DocumentCollectionUpload","BeforePhoto","Photo","PhotoPreview","__assign","BeforeVersoPhoto","PhotoConfirmation","DocumentProcessing","DocumentSuccess","DocumentError","_jsxs","ButtonDesktop"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAwFA;;;;;;;;;;;;;;;;;;;;;AAqBG;AACH,IAAM,kBAAkB,GAAG,UAAC,EAYF,EAAA;;AAXxB,IAAA,IAAA,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,IAAI,GAAA,EAAA,CAAA,IAAA,EACJ,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,cAAc,oBAAA,EACd,oBAAoB,GAAA,EAAA,CAAA,oBAAA,EACpB,oBAAoB,GAAA,EAAA,CAAA,oBAAA,EACpB,gBAAgB,GAAA,EAAA,CAAA,gBAAA,EAChB,iBAAiB,GAAA,EAAA,CAAA,iBAAA,EACjB,iBAAiB,GAAA,EAAA,CAAA,iBAAA,EACjB,uBAAuB,GAAA,EAAA,CAAA,uBAAA;AAEf,IAAA,IAAA,CAAC,GAAKA,eAAO,EAAE,EAAd;AACD,IAAA,IAAA,OAAO,GAAKC,yBAAU,EAAE,QAAjB;IAET,IAAA,EAAA,GAAgCC,cAAQ,CAAC,CAAA,gBAAgB,KAAA,IAAA,IAAhB,gBAAgB,KAAA,MAAA,GAAA,MAAA,GAAhB,gBAAgB,CAAE,KAAK,IAAG,CAAC,GAAG,CAAC,CAAC,EAAxE,WAAW,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,cAAc,GAAA,EAAA,CAAA,CAAA,CAA6C;IACzE,IAAA,EAAA,GAAkCA,cAAQ,CAAuB,IAAI,CAAC,EAArE,YAAY,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,eAAe,GAAA,EAAA,CAAA,CAAA,CAAwC;IACtE,IAAA,EAAA,GAAkDA,cAAQ,CAAS,EAAE,CAAC,EAArE,oBAAoB,GAAA,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AAS,EACpDA,cAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,qCAAqC,EAAA,QAAA,EAChD,CAAC,CAAC,4CAA4C,EAAE,sBAAsB,CAAC,EAAA,CACrE,EACLA,cAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,oBAAoB,EAAA,QAAA,EAC9B,CAAC,CAAC,kDAAkD,EAAE,yCAAyC,CAAC,EAAA,CAC/F,EACJA,cAAA,CAACe,qBAAa,IACZ,IAAI,EAAC,MAAM,EACX,SAAS,EAAC,QAAQ,EAClB,OAAO,EAAE,YAAA,EAAM,OAAA,cAAc,CAAC,CAAC,CAAC,CAAA,CAAjB,CAAiB,EAAA,QAAA,EAE/B,CAAC,CAAC,2CAA2C,EAAE,iBAAiB,CAAC,EAAA,CACpD,CAAA,EAAA,CACZ;;AAGd;;;;"}
|
|
@@ -11,9 +11,9 @@ var useI18n = require('../../hooks/useI18n.js');
|
|
|
11
11
|
var validationUtils = require('../../utils/validationUtils.js');
|
|
12
12
|
|
|
13
13
|
var DocumentError = function (_a) {
|
|
14
|
-
var documentType = _a.documentType, documentTypeLabel = _a.documentTypeLabel, onRetry = _a.onRetry, onContinueAnyway = _a.onContinueAnyway, onBackToUserInput = _a.onBackToUserInput, _b = _a.retryCount, retryCount = _b === void 0 ? 0 : _b, _c = _a.predictions, predictions = _c === void 0 ? [] : _c; _a.errorDetails; _a.allowResubmission; var maxResubmissionAttempts = _a.maxResubmissionAttempts, _d = _a.isRetryAllowed, isRetryAllowed = _d === void 0 ? true : _d, errorCode = _a.errorCode;
|
|
14
|
+
var documentType = _a.documentType, documentTypeLabel = _a.documentTypeLabel, onRetry = _a.onRetry, onContinueAnyway = _a.onContinueAnyway, onBackToUserInput = _a.onBackToUserInput, _b = _a.retryCount, retryCount = _b === void 0 ? 0 : _b, _c = _a.predictions, predictions = _c === void 0 ? [] : _c; _a.errorDetails; _a.allowResubmission; var maxResubmissionAttempts = _a.maxResubmissionAttempts, _d = _a.isRetryAllowed, isRetryAllowed = _d === void 0 ? true : _d, errorCode = _a.errorCode, _e = _a.blockContinue, blockContinue = _e === void 0 ? false : _e;
|
|
15
15
|
var t = useI18n.useI18n().t;
|
|
16
|
-
var
|
|
16
|
+
var _f = React.useState([]), validationPoints = _f[0], setValidationPoints = _f[1];
|
|
17
17
|
React.useEffect(function () {
|
|
18
18
|
// Use shared utility to get validation points
|
|
19
19
|
setValidationPoints(validationUtils.getValidationPoints(errorCode, predictions, t, "error"));
|
|
@@ -44,17 +44,21 @@ var DocumentError = function (_a) {
|
|
|
44
44
|
}
|
|
45
45
|
return translated;
|
|
46
46
|
};
|
|
47
|
-
return (jsxRuntime.jsxs("div", { className: "flex flex-col justify-between h-full w-full", children: [jsxRuntime.jsx("div", { className: "flex-1 px-4 py-6 pt-11 md:px-8 md:py-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto space-y-6", children: [jsxRuntime.jsx("div", { className: "text-center", children: jsxRuntime.jsx("div", { className: "mx-auto w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mb-4", children: jsxRuntime.jsx("div", { className: "w-8 h-8 bg-red-500 rounded-full flex items-center justify-center", children: jsxRuntime.jsx("span", { className: "text-white text-lg", children: "\u2715" }) }) }) }), jsxRuntime.jsxs("div", { className: "text-center space-y-4", children: [jsxRuntime.jsx(Title.default, { className: "text-xl md:text-2xl lg:text-3xl text-red-600", children:
|
|
48
|
-
? t("errors.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
return (jsxRuntime.jsxs("div", { className: "flex flex-col justify-between h-full w-full", children: [jsxRuntime.jsx("div", { className: "flex-1 px-4 py-6 pt-11 md:px-8 md:py-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto space-y-6", children: [jsxRuntime.jsx("div", { className: "text-center", children: jsxRuntime.jsx("div", { className: "mx-auto w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mb-4", children: jsxRuntime.jsx("div", { className: "w-8 h-8 bg-red-500 rounded-full flex items-center justify-center", children: jsxRuntime.jsx("span", { className: "text-white text-lg", children: "\u2715" }) }) }) }), jsxRuntime.jsxs("div", { className: "text-center space-y-4", children: [jsxRuntime.jsx(Title.default, { className: "text-xl md:text-2xl lg:text-3xl text-red-600", children: blockContinue
|
|
48
|
+
? t("errors.upload_not_confirmed.title")
|
|
49
|
+
: t("errors.verification_failed", "Vérification échouée") }), jsxRuntime.jsx(Subtitle.default, { className: "text-sm text-gray-600 leading-relaxed", children: blockContinue
|
|
50
|
+
? t("errors.upload_not_confirmed.subtitle")
|
|
51
|
+
: isRetryAllowed
|
|
52
|
+
? t("errors.verification_failed_subtitle", {
|
|
53
|
+
documentType: getDocumentLabel(documentType),
|
|
54
|
+
defaultValue: "Nous n'avons pas pu valider votre {{documentType}}. Veuillez vérifier les points ci-dessous et réessayer.",
|
|
55
|
+
})
|
|
56
|
+
: t("errors.verification_failed_subtitle_no_retry", {
|
|
57
|
+
documentType: getDocumentLabel(documentType),
|
|
58
|
+
defaultValue: "Nous n'avons pas pu valider votre {{documentType}}. Veuillez vérifier les points ci-dessous.",
|
|
59
|
+
}) })] }), !blockContinue && (jsxRuntime.jsxs("div", { className: "bg-red-50 border border-red-200 rounded-lg p-4", children: [jsxRuntime.jsx("h3", { className: "font-medium text-red-900 mb-2", children: t("errors.problems_detected", "Problèmes détectés") }), jsxRuntime.jsx("div", { className: "text-sm text-red-800 space-y-1", children: validationPoints.map(function (point, index) { return (jsxRuntime.jsx("p", { children: point }, index)); }) })] })), !blockContinue && !isRetryAllowed && (jsxRuntime.jsxs("div", { className: "bg-orange-50 border border-orange-200 rounded-lg p-4", children: [jsxRuntime.jsx("h3", { className: "font-medium text-orange-900 mb-2", children: t("errors.resubmission.max_attempts_reached", "Nombre maximum de tentatives atteint") }), jsxRuntime.jsx("p", { className: "text-sm text-orange-800", children: maxResubmissionAttempts !== undefined
|
|
56
60
|
? t("errors.resubmission.max_attempts_reached_description")
|
|
57
|
-
: t("errors.resubmission.no_resubmission_allowed") })] })), getUserGuidance() && (jsxRuntime.jsxs("div", { className: "bg-yellow-50 border border-yellow-200 rounded-lg p-4", children: [jsxRuntime.jsxs("h3", { className: "font-medium text-yellow-900 mb-2", children: ["\uD83D\uDCA1 ", t("errors.improvement_tips", "Conseils d'amélioration")] }), jsxRuntime.jsx("p", { className: "text-sm text-yellow-800", children: getUserGuidance() })] })), isRetryAllowed && (jsxRuntime.jsxs("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-4", children: [jsxRuntime.jsx("h3", { className: "font-medium text-blue-900 mb-2", children: t("errors.next_steps", "Prochaines étapes") }), jsxRuntime.jsx("p", { className: "text-sm text-blue-800", children: t("errors.next_steps_description", "Veuillez reprendre les photos de votre document en suivant les conseils d'amélioration pour une meilleure qualité.") })] }))] }) }), jsxRuntime.jsx("div", { className: "sticky bottom-0 md:static bg-white border-t md:border-t-0 p-4 md:p-0 md:pb-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto", children: [jsxRuntime.
|
|
61
|
+
: t("errors.resubmission.no_resubmission_allowed") })] })), !blockContinue && getUserGuidance() && (jsxRuntime.jsxs("div", { className: "bg-yellow-50 border border-yellow-200 rounded-lg p-4", children: [jsxRuntime.jsxs("h3", { className: "font-medium text-yellow-900 mb-2", children: ["\uD83D\uDCA1 ", t("errors.improvement_tips", "Conseils d'amélioration")] }), jsxRuntime.jsx("p", { className: "text-sm text-yellow-800", children: getUserGuidance() })] })), !blockContinue && isRetryAllowed && (jsxRuntime.jsxs("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-4", children: [jsxRuntime.jsx("h3", { className: "font-medium text-blue-900 mb-2", children: t("errors.next_steps", "Prochaines étapes") }), jsxRuntime.jsx("p", { className: "text-sm text-blue-800", children: t("errors.next_steps_description", "Veuillez reprendre les photos de votre document en suivant les conseils d'amélioration pour une meilleure qualité.") })] }))] }) }), jsxRuntime.jsx("div", { className: "sticky bottom-0 md:static bg-white border-t md:border-t-0 p-4 md:p-0 md:pb-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto", children: [jsxRuntime.jsx("div", { className: "flex flex-col space-y-3 md:hidden", children: blockContinue ? (jsxRuntime.jsx(ButtonDesktop.default, { onClick: onRetry, type: "continue", children: t("errors.retry_verification", "Recommencer la vérification") })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [onBackToUserInput && (jsxRuntime.jsx(ButtonDesktop.default, { onClick: onBackToUserInput, type: "back", children: t("errors.back_to_user_input", "Retour aux informations d'identité") })), retryCount >= 1 && isRetryAllowed && onContinueAnyway && (jsxRuntime.jsx(ButtonDesktop.default, { onClick: onContinueAnyway, type: "back", children: t("errors.continue_anyway", "Poursuivre tout de même") })), isRetryAllowed && (jsxRuntime.jsx(ButtonDesktop.default, { onClick: onRetry, type: "continue", children: t("errors.retry_verification", "Recommencer la vérification") })), !isRetryAllowed && onContinueAnyway && (jsxRuntime.jsx(ButtonDesktop.default, { onClick: onContinueAnyway, type: "back", children: t("errors.continue_anyway", "Poursuivre tout de même") }))] })) }), jsxRuntime.jsx("div", { className: "hidden md:flex flex-col space-y-3", children: jsxRuntime.jsx("div", { className: "flex justify-center space-x-3", children: blockContinue ? (jsxRuntime.jsx(ButtonDesktop.default, { onClick: onRetry, type: "continue", children: t("errors.retry_verification", "Recommencer la vérification") })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [onBackToUserInput && (jsxRuntime.jsx(ButtonDesktop.default, { onClick: onBackToUserInput, type: "back", children: t("errors.back_to_user_input", "Retour aux informations d'identité") })), retryCount >= 1 && isRetryAllowed && onContinueAnyway && (jsxRuntime.jsx(ButtonDesktop.default, { onClick: onContinueAnyway, type: "back", children: t("errors.continue_anyway", "Poursuivre tout de même") })), isRetryAllowed && (jsxRuntime.jsx(ButtonDesktop.default, { onClick: onRetry, type: "continue", children: t("errors.retry_verification", "Recommencer la vérification") })), !isRetryAllowed && onContinueAnyway && (jsxRuntime.jsx(ButtonDesktop.default, { onClick: onContinueAnyway, type: "continue", children: t("errors.continue_anyway", "Poursuivre tout de même") }))] })) }) })] }) })] }));
|
|
58
62
|
};
|
|
59
63
|
|
|
60
64
|
exports.default = DocumentError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentError.js","sources":["../../../../../src/components/document-collection/DocumentError.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport Button from \"../ui/Button\";\nimport ButtonDesktop from \"../ui/ButtonDesktop\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport { getValidationPoints } from \"../../utils/validationUtils\";\nimport type { DocumentErrorProps } from \"./types\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\n\nconst DocumentError: React.FC<DocumentErrorProps> = ({\n documentType,\n documentTypeLabel,\n onRetry,\n onContinueAnyway,\n onBackToUserInput,\n retryCount = 0,\n predictions = [],\n errorDetails,\n allowResubmission,\n maxResubmissionAttempts,\n isRetryAllowed = true,\n errorCode,\n}) => {\n const { t } = useI18n();\n const [validationPoints, setValidationPoints] = useState<string[]>([]);\n\n useEffect(() => {\n // Use shared utility to get validation points\n setValidationPoints(\n getValidationPoints(errorCode, predictions, t, \"error\"),\n );\n }, [predictions, errorCode, t]);\n\n // Get user guidance message if available\n const getUserGuidance = (): string | null => {\n if (!errorCode) return null;\n const guidance = t(`user_guidance.${errorCode}`, \"\");\n return guidance || null;\n };\n\n const getDocumentLabel = (documentType: string): string => {\n if (documentTypeLabel) return documentTypeLabel;\n\n const translated = t(documentType);\n // If no translation, use default fallbacks\n if (translated === documentType) {\n switch (documentType) {\n case \"national_id\":\n return t(\"documentTypes.idCard\", \"carte nationale d'identité\");\n case \"passport\":\n return t(\"documentTypes.passport\", \"passeport\");\n case \"driving_license\":\n return t(\"documentTypes.driving_license\", \"permis de conduire\");\n default:\n return t(\"documentTypes.document\", \"document\");\n }\n }\n return translated;\n };\n\n return (\n <div className=\"flex flex-col justify-between h-full w-full\">\n {/* Main content area */}\n <div className=\"flex-1 px-4 py-6 pt-11 md:px-8 md:py-8\">\n <div className=\"w-full max-w-md mx-auto space-y-6\">\n {/* Error icon */}\n <div className=\"text-center\">\n <div className=\"mx-auto w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mb-4\">\n <div className=\"w-8 h-8 bg-red-500 rounded-full flex items-center justify-center\">\n <span className=\"text-white text-lg\">✕</span>\n </div>\n </div>\n </div>\n\n {/* Header */}\n <div className=\"text-center space-y-4\">\n <Title className=\"text-xl md:text-2xl lg:text-3xl text-red-600\">\n {t(\"errors.verification_failed\", \"Vérification échouée\")}\n </Title>\n <Subtitle className=\"text-sm text-gray-600 leading-relaxed\">\n {isRetryAllowed\n ? t(\"errors.verification_failed_subtitle\", {\n documentType: getDocumentLabel(documentType),\n defaultValue:\n \"Nous n'avons pas pu valider votre {{documentType}}. Veuillez vérifier les points ci-dessous et réessayer.\",\n })\n : t(\"errors.verification_failed_subtitle_no_retry\", {\n documentType: getDocumentLabel(documentType),\n defaultValue:\n \"Nous n'avons pas pu valider votre {{documentType}}. Veuillez vérifier les points ci-dessous.\",\n })}\n </Subtitle>\n </div>\n\n {/* Error details - Validation Points */}\n <div className=\"bg-red-50 border border-red-200 rounded-lg p-4\">\n <h3 className=\"font-medium text-red-900 mb-2\">\n {t(\"errors.problems_detected\", \"Problèmes détectés\")}\n </h3>\n <div className=\"text-sm text-red-800 space-y-1\">\n {validationPoints.map((point, index) => (\n <p key={index}>{point}</p>\n ))}\n </div>\n </div>\n\n {/* Resubmission limit message */}\n {!isRetryAllowed && (\n <div className=\"bg-orange-50 border border-orange-200 rounded-lg p-4\">\n <h3 className=\"font-medium text-orange-900 mb-2\">\n {t(\n \"errors.resubmission.max_attempts_reached\",\n \"Nombre maximum de tentatives atteint\",\n )}\n </h3>\n <p className=\"text-sm text-orange-800\">\n {maxResubmissionAttempts !== undefined\n ? t(\"errors.resubmission.max_attempts_reached_description\")\n : t(\"errors.resubmission.no_resubmission_allowed\")}\n </p>\n </div>\n )}\n\n {/* User guidance - specific advice based on error code */}\n {getUserGuidance() && (\n <div className=\"bg-yellow-50 border border-yellow-200 rounded-lg p-4\">\n <h3 className=\"font-medium text-yellow-900 mb-2\">\n 💡 {t(\"errors.improvement_tips\", \"Conseils d'amélioration\")}\n </h3>\n <p className=\"text-sm text-yellow-800\">{getUserGuidance()}</p>\n </div>\n )}\n\n {/* Next steps */}\n {isRetryAllowed && (\n <div className=\"bg-blue-50 border border-blue-200 rounded-lg p-4\">\n <h3 className=\"font-medium text-blue-900 mb-2\">\n {t(\"errors.next_steps\", \"Prochaines étapes\")}\n </h3>\n <p className=\"text-sm text-blue-800\">\n {t(\n \"errors.next_steps_description\",\n \"Veuillez reprendre les photos de votre document en suivant les conseils d'amélioration pour une meilleure qualité.\",\n )}\n </p>\n </div>\n )}\n </div>\n </div>\n\n {/* Footer with buttons */}\n <div className=\"sticky bottom-0 md:static bg-white border-t md:border-t-0 p-4 md:p-0 md:pb-8\">\n <div className=\"w-full max-w-md mx-auto\">\n {/* Mobile layout */}\n <div className=\"flex flex-col space-y-3 md:hidden\">\n {onBackToUserInput && (\n <ButtonDesktop\n onClick={onBackToUserInput}\n type=\"back\"\n >\n {t(\n \"errors.back_to_user_input\",\n \"Retour aux informations d'identité\",\n )}\n </ButtonDesktop>\n )}\n {retryCount >= 1 && isRetryAllowed && (\n <ButtonDesktop\n onClick={onContinueAnyway}\n type=\"back\"\n >\n {t(\"errors.continue_anyway\", \"Poursuivre tout de même\")}\n </ButtonDesktop>\n )}\n {isRetryAllowed && (\n <ButtonDesktop onClick={onRetry} type=\"continue\">\n {t(\"errors.retry_verification\", \"Recommencer la vérification\")}\n </ButtonDesktop>\n )}\n {!isRetryAllowed && (\n <ButtonDesktop onClick={onContinueAnyway} type=\"back\">\n {t(\"errors.continue_anyway\", \"Poursuivre tout de même\")}\n </ButtonDesktop>\n )}\n </div>\n\n {/* Desktop layout */}\n <div className=\"hidden md:flex flex-col space-y-3\">\n <div className=\"flex justify-center space-x-3\">\n {onBackToUserInput && (\n <ButtonDesktop\n onClick={onBackToUserInput}\n type=\"back\"\n >\n {t(\n \"errors.back_to_user_input\",\n \"Retour aux informations d'identité\",\n )}\n </ButtonDesktop>\n )}\n {retryCount >= 1 && isRetryAllowed && (\n <ButtonDesktop onClick={onContinueAnyway} type=\"back\">\n {t(\"errors.continue_anyway\", \"Poursuivre tout de même\")}\n </ButtonDesktop>\n )}\n {isRetryAllowed && (\n <ButtonDesktop onClick={onRetry} type=\"continue\">\n {t(\n \"errors.retry_verification\",\n \"Recommencer la vérification\",\n )}\n </ButtonDesktop>\n )}\n {!isRetryAllowed && (\n <ButtonDesktop onClick={onContinueAnyway} type=\"continue\">\n {t(\"errors.continue_anyway\", \"Poursuivre tout de même\")}\n </ButtonDesktop>\n )}\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default DocumentError;\nexport type { DocumentErrorProps };\n"],"names":["useI18n","useState","useEffect","getValidationPoints","_jsxs","_jsx","Title","Subtitle","ButtonDesktop"],"mappings":";;;;;;;;;;;;AAUA,IAAM,aAAa,GAAiC,UAAC,EAapD,EAAA;QAZC,YAAY,GAAA,EAAA,CAAA,YAAA,EACZ,iBAAiB,GAAA,EAAA,CAAA,iBAAA,EACjB,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,gBAAgB,GAAA,EAAA,CAAA,gBAAA,EAChB,iBAAiB,GAAA,EAAA,CAAA,iBAAA,EACjB,EAAA,GAAA,EAAA,CAAA,UAAc,CAAA,CAAd,UAAU,GAAA,EAAA,KAAA,MAAA,GAAG,CAAC,KAAA,CAAA,CACd,EAAA,GAAA,EAAA,CAAA,WAAgB,EAAhB,WAAW,GAAA,EAAA,KAAA,MAAA,GAAG,EAAE,GAAA,EAAA,CAAA,CACJ,EAAA,CAAA,YAAA,CAAA,CACK,EAAA,CAAA,iBAAA,CAAA,KACjB,uBAAuB,GAA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AAyB,CAAC,EAAA,CACzC,CACjB,CAAA,EAAA,CACG,EAGNH,cAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,mCAAmC,EAAA,QAAA,EAChDD,eAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,+BAA+B,EAAA,QAAA,EAAA,CAC3C,iBAAiB,KAChBC,eAACG,qBAAa,EAAA,EACZ,OAAO,EAAE,iBAAiB,EAC1B,IAAI,EAAC,MAAM,YAEV,CAAC,CACA,2BAA2B,EAC3B,oCAAoC,CACrC,EAAA,CACa,CACjB,EACA,UAAU,IAAI,CAAC,IAAI,cAAc,KAChCH,cAAA,CAACG,qBAAa,IAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAC,MAAM,EAAA,QAAA,EAClD,CAAC,CAAC,wBAAwB,EAAE,yBAAyB,CAAC,GACzC,CACjB,EACA,cAAc,KACbH,cAAA,CAACG,qBAAa,EAAA,EAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,UAAU,EAAA,QAAA,EAC7C,CAAC,CACA,2BAA2B,EAC3B,6BAA6B,CAC9B,EAAA,CACa,CACjB,EACA,CAAC,cAAc,KACdH,cAAA,CAACG,qBAAa,EAAA,EAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAC,UAAU,EAAA,QAAA,EACtD,CAAC,CAAC,wBAAwB,EAAE,yBAAyB,CAAC,EAAA,CACzC,CACjB,IACG,EAAA,CACF,CAAA,EAAA,CACF,EAAA,CACF,CAAA,EAAA,CACF;AAEV;;;;"}
|
|
1
|
+
{"version":3,"file":"DocumentError.js","sources":["../../../../../src/components/document-collection/DocumentError.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport Button from \"../ui/Button\";\nimport ButtonDesktop from \"../ui/ButtonDesktop\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport { getValidationPoints } from \"../../utils/validationUtils\";\nimport type { DocumentErrorProps } from \"./types\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\n\nconst DocumentError: React.FC<DocumentErrorProps> = ({\n documentType,\n documentTypeLabel,\n onRetry,\n onContinueAnyway,\n onBackToUserInput,\n retryCount = 0,\n predictions = [],\n errorDetails,\n allowResubmission,\n maxResubmissionAttempts,\n isRetryAllowed = true,\n errorCode,\n blockContinue = false,\n}) => {\n const { t } = useI18n();\n const [validationPoints, setValidationPoints] = useState<string[]>([]);\n\n useEffect(() => {\n // Use shared utility to get validation points\n setValidationPoints(\n getValidationPoints(errorCode, predictions, t, \"error\"),\n );\n }, [predictions, errorCode, t]);\n\n // Get user guidance message if available\n const getUserGuidance = (): string | null => {\n if (!errorCode) return null;\n const guidance = t(`user_guidance.${errorCode}`, \"\");\n return guidance || null;\n };\n\n const getDocumentLabel = (documentType: string): string => {\n if (documentTypeLabel) return documentTypeLabel;\n\n const translated = t(documentType);\n // If no translation, use default fallbacks\n if (translated === documentType) {\n switch (documentType) {\n case \"national_id\":\n return t(\"documentTypes.idCard\", \"carte nationale d'identité\");\n case \"passport\":\n return t(\"documentTypes.passport\", \"passeport\");\n case \"driving_license\":\n return t(\"documentTypes.driving_license\", \"permis de conduire\");\n default:\n return t(\"documentTypes.document\", \"document\");\n }\n }\n return translated;\n };\n\n return (\n <div className=\"flex flex-col justify-between h-full w-full\">\n {/* Main content area */}\n <div className=\"flex-1 px-4 py-6 pt-11 md:px-8 md:py-8\">\n <div className=\"w-full max-w-md mx-auto space-y-6\">\n {/* Error icon */}\n <div className=\"text-center\">\n <div className=\"mx-auto w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mb-4\">\n <div className=\"w-8 h-8 bg-red-500 rounded-full flex items-center justify-center\">\n <span className=\"text-white text-lg\">✕</span>\n </div>\n </div>\n </div>\n\n {/* Header */}\n <div className=\"text-center space-y-4\">\n <Title className=\"text-xl md:text-2xl lg:text-3xl text-red-600\">\n {blockContinue\n ? t(\"errors.upload_not_confirmed.title\")\n : t(\"errors.verification_failed\", \"Vérification échouée\")}\n </Title>\n <Subtitle className=\"text-sm text-gray-600 leading-relaxed\">\n {blockContinue\n ? t(\"errors.upload_not_confirmed.subtitle\")\n : isRetryAllowed\n ? t(\"errors.verification_failed_subtitle\", {\n documentType: getDocumentLabel(documentType),\n defaultValue:\n \"Nous n'avons pas pu valider votre {{documentType}}. Veuillez vérifier les points ci-dessous et réessayer.\",\n })\n : t(\"errors.verification_failed_subtitle_no_retry\", {\n documentType: getDocumentLabel(documentType),\n defaultValue:\n \"Nous n'avons pas pu valider votre {{documentType}}. Veuillez vérifier les points ci-dessous.\",\n })}\n </Subtitle>\n </div>\n\n {/* Error details - Validation Points */}\n {!blockContinue && (\n <div className=\"bg-red-50 border border-red-200 rounded-lg p-4\">\n <h3 className=\"font-medium text-red-900 mb-2\">\n {t(\"errors.problems_detected\", \"Problèmes détectés\")}\n </h3>\n <div className=\"text-sm text-red-800 space-y-1\">\n {validationPoints.map((point, index) => (\n <p key={index}>{point}</p>\n ))}\n </div>\n </div>\n )}\n\n {/* Resubmission limit message */}\n {!blockContinue && !isRetryAllowed && (\n <div className=\"bg-orange-50 border border-orange-200 rounded-lg p-4\">\n <h3 className=\"font-medium text-orange-900 mb-2\">\n {t(\n \"errors.resubmission.max_attempts_reached\",\n \"Nombre maximum de tentatives atteint\",\n )}\n </h3>\n <p className=\"text-sm text-orange-800\">\n {maxResubmissionAttempts !== undefined\n ? t(\"errors.resubmission.max_attempts_reached_description\")\n : t(\"errors.resubmission.no_resubmission_allowed\")}\n </p>\n </div>\n )}\n\n {/* User guidance - specific advice based on error code */}\n {!blockContinue && getUserGuidance() && (\n <div className=\"bg-yellow-50 border border-yellow-200 rounded-lg p-4\">\n <h3 className=\"font-medium text-yellow-900 mb-2\">\n 💡 {t(\"errors.improvement_tips\", \"Conseils d'amélioration\")}\n </h3>\n <p className=\"text-sm text-yellow-800\">{getUserGuidance()}</p>\n </div>\n )}\n\n {/* Next steps */}\n {!blockContinue && isRetryAllowed && (\n <div className=\"bg-blue-50 border border-blue-200 rounded-lg p-4\">\n <h3 className=\"font-medium text-blue-900 mb-2\">\n {t(\"errors.next_steps\", \"Prochaines étapes\")}\n </h3>\n <p className=\"text-sm text-blue-800\">\n {t(\n \"errors.next_steps_description\",\n \"Veuillez reprendre les photos de votre document en suivant les conseils d'amélioration pour une meilleure qualité.\",\n )}\n </p>\n </div>\n )}\n </div>\n </div>\n\n {/* Footer with buttons */}\n <div className=\"sticky bottom-0 md:static bg-white border-t md:border-t-0 p-4 md:p-0 md:pb-8\">\n <div className=\"w-full max-w-md mx-auto\">\n {/* Mobile layout */}\n <div className=\"flex flex-col space-y-3 md:hidden\">\n {blockContinue ? (\n <ButtonDesktop onClick={onRetry} type=\"continue\">\n {t(\"errors.retry_verification\", \"Recommencer la vérification\")}\n </ButtonDesktop>\n ) : (\n <>\n {onBackToUserInput && (\n <ButtonDesktop onClick={onBackToUserInput} type=\"back\">\n {t(\n \"errors.back_to_user_input\",\n \"Retour aux informations d'identité\",\n )}\n </ButtonDesktop>\n )}\n {retryCount >= 1 && isRetryAllowed && onContinueAnyway && (\n <ButtonDesktop onClick={onContinueAnyway} type=\"back\">\n {t(\"errors.continue_anyway\", \"Poursuivre tout de même\")}\n </ButtonDesktop>\n )}\n {isRetryAllowed && (\n <ButtonDesktop onClick={onRetry} type=\"continue\">\n {t(\n \"errors.retry_verification\",\n \"Recommencer la vérification\",\n )}\n </ButtonDesktop>\n )}\n {!isRetryAllowed && onContinueAnyway && (\n <ButtonDesktop onClick={onContinueAnyway} type=\"back\">\n {t(\"errors.continue_anyway\", \"Poursuivre tout de même\")}\n </ButtonDesktop>\n )}\n </>\n )}\n </div>\n\n {/* Desktop layout */}\n <div className=\"hidden md:flex flex-col space-y-3\">\n <div className=\"flex justify-center space-x-3\">\n {blockContinue ? (\n <ButtonDesktop onClick={onRetry} type=\"continue\">\n {t(\n \"errors.retry_verification\",\n \"Recommencer la vérification\",\n )}\n </ButtonDesktop>\n ) : (\n <>\n {onBackToUserInput && (\n <ButtonDesktop onClick={onBackToUserInput} type=\"back\">\n {t(\n \"errors.back_to_user_input\",\n \"Retour aux informations d'identité\",\n )}\n </ButtonDesktop>\n )}\n {retryCount >= 1 && isRetryAllowed && onContinueAnyway && (\n <ButtonDesktop onClick={onContinueAnyway} type=\"back\">\n {t(\"errors.continue_anyway\", \"Poursuivre tout de même\")}\n </ButtonDesktop>\n )}\n {isRetryAllowed && (\n <ButtonDesktop onClick={onRetry} type=\"continue\">\n {t(\n \"errors.retry_verification\",\n \"Recommencer la vérification\",\n )}\n </ButtonDesktop>\n )}\n {!isRetryAllowed && onContinueAnyway && (\n <ButtonDesktop onClick={onContinueAnyway} type=\"continue\">\n {t(\"errors.continue_anyway\", \"Poursuivre tout de même\")}\n </ButtonDesktop>\n )}\n </>\n )}\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default DocumentError;\nexport type { DocumentErrorProps };\n"],"names":["useI18n","useState","useEffect","getValidationPoints","_jsxs","_jsx","Title","Subtitle","ButtonDesktop","_Fragment"],"mappings":";;;;;;;;;;;;AAUA,IAAM,aAAa,GAAiC,UAAC,EAcpD,EAAA;QAbC,YAAY,GAAA,EAAA,CAAA,YAAA,CAAA,CACZ,iBAAiB,GAAA,EAAA,CAAA,iBAAA,CAAA,CACjB,OAAO,GAAA,EAAA,CAAA,OAAA,CAAA,CACP,gBAAgB,GAAA,EAAA,CAAA,gBAAA,CAAA,CAChB,iBAAiB,uBAAA,CAAA,CACjB,EAAA,GAAA,EAAA,CAAA,UAAc,CAAA,CAAd,UAAU,GAAA,EAAA,KAAA,MAAA,GAAG,CAAC,KAAA,CAAA,CACd,EAAA,GAAA,EAAA,CAAA,WAAgB,CAAA,CAAhB,WAAW,GAAA,EAAA,KAAA,MAAA,GAAG,EAAE,KAAA,CAAA,CACJ,EAAA,CAAA,YAAA,CAAA,CACK,EAAA,CAAA,iBAAA,MACjB,uBAAuB,GAAA,EAAA,CAAA,uBAAA,CAAA,CACv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