datakeen-session-react 1.1.201 → 1.1.202-dev.10

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 (51) hide show
  1. package/dist/cjs/components/document-collection/DocumentCollection.js +2 -2
  2. package/dist/cjs/components/document-collection/DocumentError.js +18 -14
  3. package/dist/cjs/components/document-collection/DocumentProcessing.js +3 -1
  4. package/dist/cjs/components/id-check/Photo.js +42 -36
  5. package/dist/cjs/components/jdi/JDIDocumentSelection.js +3 -0
  6. package/dist/cjs/components/jdi/JDIDocumentUpload.js +5 -2
  7. package/dist/cjs/components/jdi/JDIError.js +16 -12
  8. package/dist/cjs/components/jdi/JDIProcessing.js +6 -1
  9. package/dist/cjs/components/nfc-scan/NfcScanNode.js +3 -4
  10. package/dist/cjs/components/session/DocumentCheck.js +48 -32
  11. package/dist/cjs/components/session/controleJdiPolicy.js +6 -1
  12. package/dist/cjs/components/signature-electronic/SignatureElectronic.js +13 -30
  13. package/dist/cjs/components/template/ExternalVerificationNodeHandler.js +94 -63
  14. package/dist/cjs/hooks/useStepNavigation.js +9 -1
  15. package/dist/cjs/i18n/en.json.js +11 -0
  16. package/dist/cjs/i18n/es.json.js +11 -0
  17. package/dist/cjs/i18n/fr.json.js +11 -0
  18. package/dist/cjs/index.css.js +1 -1
  19. package/dist/cjs/services/analysis.js +7 -0
  20. package/dist/cjs/services/cameraService.js +44 -23
  21. package/dist/cjs/services/pollingService.js +4 -1
  22. package/dist/cjs/services/sessionService.js +20 -10
  23. package/dist/cjs/utils/analysisErrors.js +11 -0
  24. package/dist/cjs/utils/cameraResolution.js +12 -0
  25. package/dist/cjs/utils/sessionStatus.js +3 -2
  26. package/dist/esm/components/document-collection/DocumentCollection.js +2 -2
  27. package/dist/esm/components/document-collection/DocumentError.js +18 -14
  28. package/dist/esm/components/document-collection/DocumentProcessing.js +4 -2
  29. package/dist/esm/components/id-check/Photo.js +42 -36
  30. package/dist/esm/components/jdi/JDIDocumentSelection.js +3 -0
  31. package/dist/esm/components/jdi/JDIDocumentUpload.js +5 -2
  32. package/dist/esm/components/jdi/JDIError.js +16 -12
  33. package/dist/esm/components/jdi/JDIProcessing.js +7 -2
  34. package/dist/esm/components/nfc-scan/NfcScanNode.js +3 -4
  35. package/dist/esm/components/session/DocumentCheck.js +48 -32
  36. package/dist/esm/components/session/controleJdiPolicy.js +6 -1
  37. package/dist/esm/components/signature-electronic/SignatureElectronic.js +13 -30
  38. package/dist/esm/components/template/ExternalVerificationNodeHandler.js +94 -63
  39. package/dist/esm/hooks/useStepNavigation.js +9 -1
  40. package/dist/esm/i18n/en.json.js +11 -0
  41. package/dist/esm/i18n/es.json.js +11 -0
  42. package/dist/esm/i18n/fr.json.js +11 -0
  43. package/dist/esm/index.css.js +1 -1
  44. package/dist/esm/services/analysis.js +7 -0
  45. package/dist/esm/services/cameraService.js +44 -23
  46. package/dist/esm/services/pollingService.js +4 -1
  47. package/dist/esm/services/sessionService.js +20 -11
  48. package/dist/esm/utils/analysisErrors.js +10 -1
  49. package/dist/esm/utils/cameraResolution.js +9 -0
  50. package/dist/esm/utils/sessionStatus.js +3 -2
  51. package/package.json +2 -1
@@ -2,7 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var tslib_es6 = require('../../node_modules/tslib/tslib.es6.js');
6
5
  var jsxRuntime = require('react/jsx-runtime');
7
6
  var React = require('react');
8
7
  var reactI18next = require('react-i18next');
@@ -10,7 +9,6 @@ var index = require('../../i18n/index.js');
10
9
  var SignatureElectronicIntroduction = require('./SignatureElectronicIntroduction.js');
11
10
  var DocusealSignature = require('./DocusealSignature.js');
12
11
  var SignedDocumentPreview = require('./SignedDocumentPreview.js');
13
- var sessionService = require('../../services/sessionService.js');
14
12
 
15
13
  /**
16
14
  * Maps an InformationFieldKey (journey field) to the corresponding UserInput key.
@@ -90,34 +88,19 @@ var SignatureElectronic = function (_a) {
90
88
  var handleContinue = function () {
91
89
  setShowSignature(true);
92
90
  };
93
- var handleComplete = function () { return tslib_es6.__awaiter(void 0, void 0, void 0, function () {
94
- var err_1;
95
- return tslib_es6.__generator(this, function (_a) {
96
- switch (_a.label) {
97
- case 0:
98
- if (typeof window !== "undefined") {
99
- window.sessionStorage.removeItem(signatureViewStorageKey);
100
- }
101
- _a.label = 1;
102
- case 1:
103
- _a.trys.push([1, 3, , 4]);
104
- return [4 /*yield*/, sessionService.updateSessionStatus(sessionId, "conform")];
105
- case 2:
106
- _a.sent();
107
- return [3 /*break*/, 4];
108
- case 3:
109
- err_1 = _a.sent();
110
- console.error("[SignatureElectronic] Failed to update session status:", err_1);
111
- return [3 /*break*/, 4];
112
- case 4:
113
- // Toujours montrer le document réellement signé avant de continuer
114
- // (rassure l'utilisateur — pas de bascule directe vers l'étape suivante).
115
- setSignedAt(new Date().toISOString());
116
- setShowSignedDocumentPreview(true);
117
- return [2 /*return*/];
118
- }
119
- });
120
- }); };
91
+ var handleComplete = function () {
92
+ if (typeof window !== "undefined") {
93
+ window.sessionStorage.removeItem(signatureViewStorageKey);
94
+ }
95
+ // La signature ne modifie PLUS le statut de la session (APP3-1996) : seul le
96
+ // nœud « end » le fait (PATCH `ended`). Poser `conform` ici affichait « Conforme »
97
+ // dans le backoffice, en vert, entre la signature et la fin du parcours, alors
98
+ // que le verdict n'était pas encore rendu.
99
+ // Toujours montrer le document réellement signé avant de continuer
100
+ // (rassure l'utilisateur — pas de bascule directe vers l'étape suivante).
101
+ setSignedAt(new Date().toISOString());
102
+ setShowSignedDocumentPreview(true);
103
+ };
121
104
  var handleContinueFromPreview = function () {
122
105
  // Progress to the next step via graph edges (pas d'arithmétique — évite de sauter dans la mauvaise branche)
123
106
  stepObject.goToNextStep(node.id, session.template);
@@ -8,6 +8,7 @@ var React = require('react');
8
8
  var reactI18next = require('react-i18next');
9
9
  var index = require('../../i18n/index.js');
10
10
  var api = require('../../services/api.js');
11
+ var sessionService = require('../../services/sessionService.js');
11
12
  var check = require('../../assets/check.svg.js');
12
13
  var LoadingState = require('../states/LoadingState.js');
13
14
  var Title = require('../ui/Title.js');
@@ -193,10 +194,10 @@ var ExternalVerificationNodeHandler = function (_a) {
193
194
  React.useEffect(function () {
194
195
  var abortController = new AbortController();
195
196
  var run = function () { return tslib_es6.__awaiter(void 0, void 0, void 0, function () {
196
- var result, referenceField, referenceValueMasked, resolvedReferenceValue, referenceNodeId, referenceVariable, submittedFirstName, submittedLastName, submittedSiren, nodeInput, userInputFlat, nodeScopedKeys, lookupKeys, referenceValue, allCustomFields, _i, _a, _b, value, str, comparisonConfig, cfg, personNodeInput, flat, isPersonneMorale, sirenKeys, firstNameKeys, lastNameKeys, birthDateKeys, dateOfBirth, response, res, apiErr_1, apiResult, inpi, cfg, isPersonneMorale_1;
197
- var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
198
- return tslib_es6.__generator(this, function (_w) {
199
- switch (_w.label) {
197
+ var result, referenceField, referenceValueMasked, resolvedReferenceValue, referenceNodeId, referenceVariable, submittedFirstName, submittedLastName, submittedSiren, nodeInput, userInputFlat, nodeScopedKeys, lookupKeys, referenceValue, allCustomFields, _i, _a, _b, value, str, comparisonConfig, cfg, personRefId_1, personNodeInput_1, fromIdentityCopy, fresh, error_1, flat, isPersonneMorale, sirenKeys, firstNameKeys, lastNameKeys, birthDateKeys, dateOfBirth, response, res, apiErr_1, apiResult, inpi, cfg, isPersonneMorale_1;
198
+ var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
199
+ return tslib_es6.__generator(this, function (_y) {
200
+ switch (_y.label) {
200
201
  case 0:
201
202
  result = {
202
203
  isVerified: false,
@@ -210,9 +211,9 @@ var ExternalVerificationNodeHandler = function (_a) {
210
211
  submittedFirstName = '';
211
212
  submittedLastName = '';
212
213
  submittedSiren = '';
213
- _w.label = 1;
214
+ _y.label = 1;
214
215
  case 1:
215
- _w.trys.push([1, 9, , 10]);
216
+ _y.trys.push([1, 15, , 16]);
216
217
  if (!(session === null || session === void 0 ? void 0 : session.id))
217
218
  throw new Error('Session ID is missing');
218
219
  referenceField = normalizeReferenceField(String(nodeData.referenceField || referenceVariable || ''));
@@ -223,7 +224,7 @@ var ExternalVerificationNodeHandler = function (_a) {
223
224
  message: 'External verification node is missing reference configuration.',
224
225
  errorCode: 'MISSING_REFERENCE_CONFIG',
225
226
  };
226
- return [3 /*break*/, 8];
227
+ return [3 /*break*/, 14];
227
228
  case 2:
228
229
  nodeInput = userInput[referenceNodeId];
229
230
  userInputFlat = userInput;
@@ -266,71 +267,101 @@ var ExternalVerificationNodeHandler = function (_a) {
266
267
  message: 'No SIREN/SIRET value found in source node data.',
267
268
  errorCode: 'REFERENCE_VALUE_NOT_FOUND',
268
269
  };
269
- return [3 /*break*/, 8];
270
+ return [3 /*break*/, 14];
270
271
  case 3:
271
272
  resolvedReferenceValue = referenceValue;
272
273
  referenceValueMasked = maskReferenceValue(referenceValue);
273
274
  comparisonConfig = void 0;
274
- if (isInpiRbe && ((_d = nodeData.comparisonConfig) === null || _d === void 0 ? void 0 : _d.personReferenceNodeId)) {
275
- cfg = nodeData.comparisonConfig;
276
- personNodeInput = (_e = userInput[cfg.personReferenceNodeId]) !== null && _e !== void 0 ? _e : {};
277
- flat = userInput;
278
- isPersonneMorale = cfg.personType === 'MORALE';
279
- if (isPersonneMorale) {
280
- sirenKeys = expandFieldKey((_f = cfg.personSirenField) !== null && _f !== void 0 ? _f : '').filter(Boolean);
281
- submittedSiren = (_g = resolveFieldValue(personNodeInput, flat, sirenKeys)) !== null && _g !== void 0 ? _g : '';
282
- if (submittedSiren) {
283
- comparisonConfig = {
284
- personType: 'MORALE',
285
- siren: submittedSiren,
286
- // Un RBE est toujours une personne physique en droit
287
- // français : forcé à 'mandataires' quel que soit le
288
- // contenu de cfg.compareTargets (défense en profondeur).
289
- compareTargets: ['mandataires'],
290
- };
291
- }
275
+ if (!(isInpiRbe && ((_d = nodeData.comparisonConfig) === null || _d === void 0 ? void 0 : _d.personReferenceNodeId))) return [3 /*break*/, 9];
276
+ cfg = nodeData.comparisonConfig;
277
+ personRefId_1 = cfg.personReferenceNodeId;
278
+ personNodeInput_1 = userInput[personRefId_1];
279
+ fromIdentityCopy = ((_f = (_e = session.template) === null || _e === void 0 ? void 0 : _e.nodes) !== null && _f !== void 0 ? _f : []).some(function (n) { return n.id === personRefId_1 &&
280
+ (n.type === 'controle-jdi' || n.type === 'identity-control') &&
281
+ n.copyIdentityToUserInput === true; });
282
+ if (!(fromIdentityCopy && !personNodeInput_1)) return [3 /*break*/, 8];
283
+ _y.label = 4;
284
+ case 4:
285
+ _y.trys.push([4, 6, , 7]);
286
+ return [4 /*yield*/, sessionService.fetchSessionById(session.id)];
287
+ case 5:
288
+ fresh = _y.sent();
289
+ personNodeInput_1 = (_g = fresh === null || fresh === void 0 ? void 0 : fresh.userInput) === null || _g === void 0 ? void 0 : _g[personRefId_1];
290
+ if (personNodeInput_1) {
291
+ setUserInput(function (prev) {
292
+ var _a;
293
+ return (tslib_es6.__assign(tslib_es6.__assign({}, prev), (_a = {}, _a[personRefId_1] = personNodeInput_1, _a)));
294
+ });
295
+ }
296
+ return [3 /*break*/, 7];
297
+ case 6:
298
+ error_1 = _y.sent();
299
+ console.warn('[ExternalVerification] Identité reportée indisponible', error_1);
300
+ return [3 /*break*/, 7];
301
+ case 7:
302
+ if (abortController.signal.aborted)
303
+ return [2 /*return*/];
304
+ _y.label = 8;
305
+ case 8:
306
+ personNodeInput_1 = personNodeInput_1 !== null && personNodeInput_1 !== void 0 ? personNodeInput_1 : {};
307
+ flat = fromIdentityCopy ? {} : userInput;
308
+ isPersonneMorale = cfg.personType === 'MORALE';
309
+ if (isPersonneMorale) {
310
+ sirenKeys = expandFieldKey((_h = cfg.personSirenField) !== null && _h !== void 0 ? _h : '').filter(Boolean);
311
+ submittedSiren = (_j = resolveFieldValue(personNodeInput_1, flat, sirenKeys)) !== null && _j !== void 0 ? _j : '';
312
+ if (submittedSiren) {
313
+ comparisonConfig = {
314
+ personType: 'MORALE',
315
+ siren: submittedSiren,
316
+ // Un RBE est toujours une personne physique en droit
317
+ // français : forcé à 'mandataires' quel que soit le
318
+ // contenu de cfg.compareTargets (défense en profondeur).
319
+ compareTargets: ['mandataires'],
320
+ };
292
321
  }
293
- else {
294
- firstNameKeys = expandFieldKey((_h = cfg.personFirstNameField) !== null && _h !== void 0 ? _h : '').filter(Boolean);
295
- lastNameKeys = expandFieldKey((_j = cfg.personLastNameField) !== null && _j !== void 0 ? _j : '').filter(Boolean);
296
- birthDateKeys = cfg.personBirthDateField
297
- ? expandFieldKey(cfg.personBirthDateField).filter(Boolean)
298
- : [];
299
- submittedFirstName = (_k = resolveFieldValue(personNodeInput, flat, firstNameKeys)) !== null && _k !== void 0 ? _k : '';
300
- submittedLastName = (_l = resolveFieldValue(personNodeInput, flat, lastNameKeys)) !== null && _l !== void 0 ? _l : '';
301
- dateOfBirth = cfg.compareBirthDate && birthDateKeys.length
302
- ? resolveFieldValue(personNodeInput, flat, birthDateKeys)
303
- : undefined;
304
- if (submittedFirstName && submittedLastName) {
305
- comparisonConfig = tslib_es6.__assign({ firstName: submittedFirstName, lastName: submittedLastName, compareTargets: (_m = cfg.compareTargets) !== null && _m !== void 0 ? _m : ['mandataires'] }, (dateOfBirth ? { dateOfBirth: dateOfBirth } : {}));
306
- }
322
+ }
323
+ else {
324
+ firstNameKeys = expandFieldKey((_k = cfg.personFirstNameField) !== null && _k !== void 0 ? _k : '').filter(Boolean);
325
+ lastNameKeys = expandFieldKey((_l = cfg.personLastNameField) !== null && _l !== void 0 ? _l : '').filter(Boolean);
326
+ birthDateKeys = cfg.personBirthDateField
327
+ ? expandFieldKey(cfg.personBirthDateField).filter(Boolean)
328
+ : [];
329
+ submittedFirstName = (_m = resolveFieldValue(personNodeInput_1, flat, firstNameKeys)) !== null && _m !== void 0 ? _m : '';
330
+ submittedLastName = (_o = resolveFieldValue(personNodeInput_1, flat, lastNameKeys)) !== null && _o !== void 0 ? _o : '';
331
+ dateOfBirth = cfg.compareBirthDate && birthDateKeys.length
332
+ ? resolveFieldValue(personNodeInput_1, flat, birthDateKeys)
333
+ : undefined;
334
+ if (submittedFirstName && submittedLastName) {
335
+ comparisonConfig = tslib_es6.__assign({ firstName: submittedFirstName, lastName: submittedLastName, compareTargets: (_p = cfg.compareTargets) !== null && _p !== void 0 ? _p : ['mandataires'] }, (dateOfBirth ? { dateOfBirth: dateOfBirth } : {}));
307
336
  }
308
337
  }
338
+ _y.label = 9;
339
+ case 9:
309
340
  if (isInpiRbe)
310
341
  advanceStep(1);
311
- _w.label = 4;
312
- case 4:
313
- _w.trys.push([4, 7, , 8]);
342
+ _y.label = 10;
343
+ case 10:
344
+ _y.trys.push([10, 13, , 14]);
314
345
  return [4 /*yield*/, api.apiService.post("/session/sdk/".concat(session.id, "/verify-external/").concat(node.id), tslib_es6.__assign({ apiType: apiType, referenceValue: referenceValue, referenceField: referenceField, enableRnaFallback: isInpiRbe && nodeData.rnaFallbackEnabled === true, enableInseeFallback: isInpiRbe && nodeData.enableInseeFallback === true }, (comparisonConfig ? { comparisonConfig: comparisonConfig } : {})), { signal: abortController.signal })];
315
- case 5:
316
- response = _w.sent();
346
+ case 11:
347
+ response = _y.sent();
317
348
  if (isInpiRbe)
318
349
  advanceStep(2);
319
350
  return [4 /*yield*/, new Promise(function (r) { return setTimeout(r, 600); })];
320
- case 6:
321
- _w.sent();
322
- res = (_o = response.data) === null || _o === void 0 ? void 0 : _o.data;
351
+ case 12:
352
+ _y.sent();
353
+ res = (_q = response.data) === null || _q === void 0 ? void 0 : _q.data;
323
354
  if (res && typeof res.isVerified === 'boolean') {
324
355
  result = res;
325
356
  }
326
- return [3 /*break*/, 8];
327
- case 7:
328
- apiErr_1 = _w.sent();
357
+ return [3 /*break*/, 14];
358
+ case 13:
359
+ apiErr_1 = _y.sent();
329
360
  if (abortController.signal.aborted)
330
361
  return [2 /*return*/];
331
362
  if (isInpiRbe)
332
363
  advanceStep(2);
333
- apiResult = (_q = (_p = apiErr_1 === null || apiErr_1 === void 0 ? void 0 : apiErr_1.response) === null || _p === void 0 ? void 0 : _p.data) === null || _q === void 0 ? void 0 : _q.data;
364
+ apiResult = (_s = (_r = apiErr_1 === null || apiErr_1 === void 0 ? void 0 : apiErr_1.response) === null || _r === void 0 ? void 0 : _r.data) === null || _s === void 0 ? void 0 : _s.data;
334
365
  if (apiResult && typeof apiResult.isVerified === 'boolean') {
335
366
  result = apiResult;
336
367
  }
@@ -342,18 +373,18 @@ var ExternalVerificationNodeHandler = function (_a) {
342
373
  errorCode: 'REQUEST_FAILED',
343
374
  };
344
375
  }
345
- return [3 /*break*/, 8];
346
- case 8: return [3 /*break*/, 10];
347
- case 9:
348
- _w.sent();
376
+ return [3 /*break*/, 14];
377
+ case 14: return [3 /*break*/, 16];
378
+ case 15:
379
+ _y.sent();
349
380
  result = {
350
381
  isVerified: false,
351
382
  status: 'external_error',
352
383
  message: 'Unexpected error during verification.',
353
384
  errorCode: 'UNEXPECTED_ERROR',
354
385
  };
355
- return [3 /*break*/, 10];
356
- case 10:
386
+ return [3 /*break*/, 16];
387
+ case 16:
357
388
  if (abortController.signal.aborted)
358
389
  return [2 /*return*/];
359
390
  completeSteps();
@@ -385,13 +416,13 @@ var ExternalVerificationNodeHandler = function (_a) {
385
416
  // physique, tous les mandataires sont listés : une société
386
417
  // mandataire (ex. holding présidente) explique pourquoi la
387
418
  // personne saisie n'apparaît pas en direct au RNE.
388
- mandataires: ((_r = inpi === null || inpi === void 0 ? void 0 : inpi.mandataires) !== null && _r !== void 0 ? _r : []).filter(function (m) {
419
+ mandataires: ((_t = inpi === null || inpi === void 0 ? void 0 : inpi.mandataires) !== null && _t !== void 0 ? _t : []).filter(function (m) {
389
420
  return isPersonneMorale_1 ? m.type === 'personne_morale' : true;
390
421
  }),
391
- beneficiairesEffectifs: (_s = inpi === null || inpi === void 0 ? void 0 : inpi.beneficiairesEffectifs) !== null && _s !== void 0 ? _s : [],
392
- compareTargets: isPersonneMorale_1 ? ['mandataires'] : ((_t = cfg === null || cfg === void 0 ? void 0 : cfg.compareTargets) !== null && _t !== void 0 ? _t : ['mandataires']),
393
- personNodeId: (_u = cfg === null || cfg === void 0 ? void 0 : cfg.personReferenceNodeId) !== null && _u !== void 0 ? _u : '',
394
- targetDenomination: (_v = inpi === null || inpi === void 0 ? void 0 : inpi.identite) === null || _v === void 0 ? void 0 : _v.denomination,
422
+ beneficiairesEffectifs: (_u = inpi === null || inpi === void 0 ? void 0 : inpi.beneficiairesEffectifs) !== null && _u !== void 0 ? _u : [],
423
+ compareTargets: isPersonneMorale_1 ? ['mandataires'] : ((_v = cfg === null || cfg === void 0 ? void 0 : cfg.compareTargets) !== null && _v !== void 0 ? _v : ['mandataires']),
424
+ personNodeId: (_w = cfg === null || cfg === void 0 ? void 0 : cfg.personReferenceNodeId) !== null && _w !== void 0 ? _w : '',
425
+ targetDenomination: (_x = inpi === null || inpi === void 0 ? void 0 : inpi.identite) === null || _x === void 0 ? void 0 : _x.denomination,
395
426
  siren: resolvedReferenceValue,
396
427
  sirenNodeId: referenceNodeId,
397
428
  source: inpi === null || inpi === void 0 ? void 0 : inpi.source,
@@ -42,6 +42,7 @@ var useStepNavigation = function (sessionId, sessionStatus$1, initialStep, templ
42
42
  var hasInitialized = React.useRef(false);
43
43
  var committedNavigationPending = React.useRef(false);
44
44
  var setStep = function (newStep, skipHistory) {
45
+ var _a;
45
46
  if (skipHistory === void 0) { skipHistory = false; }
46
47
  if (!skipHistory && newStep !== step) {
47
48
  setHistory(function (prev) {
@@ -53,7 +54,14 @@ var useStepNavigation = function (sessionId, sessionStatus$1, initialStep, templ
53
54
  setStepState(newStep);
54
55
  // Update current step in database
55
56
  if (sessionId) {
56
- sessionService.updateSessionCurrentStep(sessionId, newStep).catch(function (error) {
57
+ // APP3-1999 : id stable du nœud atteint (aucun pour l'accueil 0 et le QR 0.5).
58
+ var nodeId = template && Number.isInteger(newStep) && newStep >= 1
59
+ ? (_a = sessionService.getOrderedJourneySteps(template)[newStep - 1]) === null || _a === void 0 ? void 0 : _a.id
60
+ : undefined;
61
+ var update = nodeId
62
+ ? sessionService.updateSessionCurrentStep(sessionId, newStep, nodeId)
63
+ : sessionService.updateSessionCurrentStep(sessionId, newStep);
64
+ update.catch(function (error) {
57
65
  console.error("Failed to update current step in database:", error);
58
66
  // Non-blocking error - the step is still updated locally
59
67
  });
@@ -502,6 +502,7 @@ var jdi = {
502
502
  error_select_document: "Please select a document type",
503
503
  info_title: "Important information",
504
504
  instructions: {
505
+ two_sided_files: "• Ensure both sides of the document (front and back) are included, either in a single file or in two separate files.",
505
506
  jdd: {
506
507
  recent: "• The document must be recent (less than 3 months old).",
507
508
  name_address_visible: "• Your name and address must be clearly visible.",
@@ -784,11 +785,21 @@ var id_check = {
784
785
  alt_verso: "Before taking the verso photo"
785
786
  },
786
787
  camera: {
788
+ low_resolution: {
789
+ title: "Limited camera resolution",
790
+ body: "Your camera resolution is below HD. The photo may be blurry, but you can continue.",
791
+ tips: "Close other apps using the camera, choose another camera or switch to mobile, and improve the lighting.",
792
+ retry: "Try again"
793
+ },
787
794
  error_title: "Camera error",
788
795
  retry: "Retry",
789
796
  document_detected: "Document detected"
790
797
  },
791
798
  photo: {
799
+ hint: {
800
+ too_dark: "Too dark, find more light",
801
+ too_bright: "Too much glare, avoid direct light"
802
+ },
792
803
  capture_failed: "Capture failed. Please try again.",
793
804
  mode_autocapture: "Autocapture enabled",
794
805
  mode_manual: "Manual mode",
@@ -502,6 +502,7 @@ var jdi = {
502
502
  error_select_document: "Selecciona un tipo de documento",
503
503
  info_title: "Información importante",
504
504
  instructions: {
505
+ two_sided_files: "• Asegúrese de que ambas caras del documento (anverso y reverso) estén presentes, en un mismo archivo o en dos archivos distintos.",
505
506
  jdd: {
506
507
  recent: "• El documento debe ser reciente (menos de 3 meses).",
507
508
  name_address_visible: "• Tu nombre y dirección deben verse claramente.",
@@ -784,11 +785,21 @@ var id_check = {
784
785
  alt_verso: "Antes de tomar la foto del reverso"
785
786
  },
786
787
  camera: {
788
+ low_resolution: {
789
+ title: "Resolución de cámara limitada",
790
+ body: "La resolución de la cámara es inferior a HD. La foto puede salir borrosa, pero puede continuar.",
791
+ tips: "Cierre otras aplicaciones que usen la cámara, elija otra cámara o pase al móvil y mejore la iluminación.",
792
+ retry: "Reintentar"
793
+ },
787
794
  error_title: "Error de cámara",
788
795
  retry: "Reintentar",
789
796
  document_detected: "Documento detectado"
790
797
  },
791
798
  photo: {
799
+ hint: {
800
+ too_dark: "Demasiado oscuro, busque más luz",
801
+ too_bright: "Demasiados reflejos, evite la luz directa"
802
+ },
792
803
  capture_failed: "La captura ha fallado. Inténtalo de nuevo.",
793
804
  mode_autocapture: "Captura automática activada",
794
805
  mode_manual: "Modo manual",
@@ -502,6 +502,7 @@ var jdi = {
502
502
  error_select_document: "Veuillez sélectionner un type de document",
503
503
  info_title: "Information importante",
504
504
  instructions: {
505
+ two_sided_files: "• Assurez-vous que les deux faces du document (recto et verso) sont présentes, dans un même fichier ou dans deux fichiers distincts.",
505
506
  jdd: {
506
507
  recent: "• Le document doit être récent (moins de 3 mois).",
507
508
  name_address_visible: "• Votre nom et adresse doivent être clairement visibles.",
@@ -784,11 +785,21 @@ var id_check = {
784
785
  alt_verso: "Avant de prendre la photo du verso"
785
786
  },
786
787
  camera: {
788
+ low_resolution: {
789
+ title: "Résolution de la caméra limitée",
790
+ body: "La résolution de votre caméra est inférieure à la HD. La photo risque d’être floue, mais vous pouvez continuer.",
791
+ tips: "Fermez les autres applications utilisant la caméra, choisissez une autre caméra ou passez sur mobile, et améliorez l’éclairage.",
792
+ retry: "Réessayer"
793
+ },
787
794
  error_title: "Erreur de caméra",
788
795
  retry: "Réessayer",
789
796
  document_detected: "Document détecté"
790
797
  },
791
798
  photo: {
799
+ hint: {
800
+ too_dark: "Trop sombre, cherchez plus de lumière",
801
+ too_bright: "Trop de reflets, évitez la lumière directe"
802
+ },
792
803
  capture_failed: "La capture a échoué. Veuillez réessayer.",
793
804
  mode_autocapture: "Autocapture activée",
794
805
  mode_manual: "Mode manuel",