datakeen-session-react 1.1.140-rc.55 → 1.1.140-rc.57
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/dist/cjs/components/document-collection/DocumentCollection.js +20 -23
- package/dist/cjs/components/document-collection/DocumentCollection.js.map +1 -1
- package/dist/cjs/components/document-collection/DocumentCollectionUpload.js +9 -1
- package/dist/cjs/components/document-collection/DocumentCollectionUpload.js.map +1 -1
- package/dist/cjs/components/id-check/Photo.js +1 -2
- package/dist/cjs/components/id-check/Photo.js.map +1 -1
- package/dist/cjs/components/id-check/PhotoPreview.js +39 -0
- package/dist/cjs/components/id-check/PhotoPreview.js.map +1 -0
- package/dist/cjs/components/jdi/JDIDocumentUpload.js +1 -1
- package/dist/cjs/components/jdi/JDIDocumentUpload.js.map +1 -1
- package/dist/cjs/components/session/DocumentCheck.js +35 -32
- package/dist/cjs/components/session/DocumentCheck.js.map +1 -1
- package/dist/cjs/components/template/TemplateNodeRenderer.js +1 -1
- package/dist/cjs/components/template/TemplateNodeRenderer.js.map +1 -1
- package/dist/cjs/hooks/useUserInputForm.js +6 -1
- package/dist/cjs/hooks/useUserInputForm.js.map +1 -1
- package/dist/cjs/i18n/en.json.js +11 -0
- package/dist/cjs/i18n/en.json.js.map +1 -1
- package/dist/cjs/i18n/fr.json.js +11 -0
- package/dist/cjs/i18n/fr.json.js.map +1 -1
- package/dist/cjs/index.css.js +1 -1
- package/dist/cjs/services/analysis.js +1 -5
- package/dist/cjs/services/analysis.js.map +1 -1
- package/dist/cjs/services/auditTrailService.js +73 -0
- package/dist/cjs/services/auditTrailService.js.map +1 -1
- package/dist/cjs/services/cameraService.js +54 -9
- package/dist/cjs/services/cameraService.js.map +1 -1
- package/dist/esm/components/document-collection/DocumentCollection.js +21 -24
- package/dist/esm/components/document-collection/DocumentCollection.js.map +1 -1
- package/dist/esm/components/document-collection/DocumentCollectionUpload.js +9 -1
- package/dist/esm/components/document-collection/DocumentCollectionUpload.js.map +1 -1
- package/dist/esm/components/id-check/Photo.js +1 -2
- package/dist/esm/components/id-check/Photo.js.map +1 -1
- package/dist/esm/components/id-check/PhotoPreview.js +35 -0
- package/dist/esm/components/id-check/PhotoPreview.js.map +1 -0
- package/dist/esm/components/jdi/JDIDocumentUpload.js +1 -1
- package/dist/esm/components/jdi/JDIDocumentUpload.js.map +1 -1
- package/dist/esm/components/session/DocumentCheck.js +35 -32
- package/dist/esm/components/session/DocumentCheck.js.map +1 -1
- package/dist/esm/components/template/TemplateNodeRenderer.js +1 -1
- package/dist/esm/components/template/TemplateNodeRenderer.js.map +1 -1
- package/dist/esm/hooks/useUserInputForm.js +6 -1
- package/dist/esm/hooks/useUserInputForm.js.map +1 -1
- package/dist/esm/i18n/en.json.js +11 -0
- package/dist/esm/i18n/en.json.js.map +1 -1
- package/dist/esm/i18n/fr.json.js +11 -0
- package/dist/esm/i18n/fr.json.js.map +1 -1
- package/dist/esm/index.css.js +1 -1
- package/dist/esm/services/analysis.js +1 -5
- package/dist/esm/services/analysis.js.map +1 -1
- package/dist/esm/services/auditTrailService.js +67 -1
- package/dist/esm/services/auditTrailService.js.map +1 -1
- package/dist/esm/services/cameraService.js +54 -9
- package/dist/esm/services/cameraService.js.map +1 -1
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@ var documentLabels = require('../../utils/documentLabels.js');
|
|
|
15
15
|
var MobilePageLayout = require('../ui/MobilePageLayout.js');
|
|
16
16
|
|
|
17
17
|
var JDIDocumentUpload = function (_a) {
|
|
18
|
-
var documentType = _a.documentType, onUpload = _a.onUpload, onBack = _a.onBack, documentTypeId = _a.documentTypeId, documentLabel = _a.documentLabel, _b = _a.initialFront, initialFront = _b === void 0 ? null : _b, _c = _a.initialBack, initialBack = _c === void 0 ? null : _c;
|
|
18
|
+
var documentType = _a.documentType, onUpload = _a.onUpload, onBack = _a.onBack, documentTypeId = _a.documentTypeId, documentLabel = _a.documentLabel, _b = _a.initialFront, initialFront = _b === void 0 ? null : _b, _c = _a.initialBack, initialBack = _c === void 0 ? null : _c; _a.sessionId;
|
|
19
19
|
var t = useI18n.useI18n().t;
|
|
20
20
|
// Helper functions for conditional text
|
|
21
21
|
var getDropZoneText = function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JDIDocumentUpload.js","sources":["../../../../../src/components/jdi/JDIDocumentUpload.tsx"],"sourcesContent":["import { useState, useRef, useEffect } from \"react\";\n\nimport Button from \"../ui/Button\";\nimport PageActions from \"../ui/PageActions\";\nimport { Card } from \"../ui/Card\";\nimport PDFPreview from \"../ui/PDFPreview\";\nimport type { onUploadFiles } from \"../../types/uploadFiles\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport {\n convertFileToSupportedFormat,\n fileToBase64,\n isPDF,\n isValidFileType,\n isValidFileSize,\n isValidBase64Data,\n} from \"../../utils/fileConverter\";\nimport { requiresTwoSides } from \"../../utils/documentLabels\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\n\ninterface JDIDocumentUploadProps {\n documentType: string;\n onUpload: (files: onUploadFiles) => void;\n onBack: () => void;\n documentTypeId?: string; // Pour identifier des types spécifiques comme jdd ou income-proof\n documentLabel?: string; // Le label lisible du document sélectionné (ex: \"Carte nationale d'identité\")\n initialFront?: string | null; // Base64 du recto déjà déposé (ex: après erreur 2.5)\n initialBack?: string | null; // Base64 du verso déjà déposé (ex: après erreur 2.5)\n}\n\nconst JDIDocumentUpload = ({\n documentType,\n onUpload,\n onBack,\n documentTypeId,\n documentLabel,\n initialFront = null,\n initialBack = null,\n}: JDIDocumentUploadProps) => {\n const { t } = useI18n();\n\n // Helper functions for conditional text\n const getDropZoneText = () => {\n return t(\"jdi.document_upload.drop_zone\", {\n document: t(\"documentTypes.\" + documentType),\n });\n };\n\n const getUploadInstruction = () => {\n switch (documentTypeId) {\n case \"jdd\":\n return t(\"jdi.document_upload.upload_jdd\");\n case \"income-proof\":\n return t(\"jdi.document_upload.upload_income_proof\");\n default:\n return t(\"jdi.document_upload.upload_identity\", {\n document: t(\"documentTypes.\" + documentType),\n });\n }\n };\n\n const getValidateButtonText = () => {\n if (isUploading) {\n return t(\"jdi.document_upload.uploading\");\n }\n return documentTypeId === \"jdd\" || documentTypeId === \"income-proof\"\n ? t(\"jdi.document_upload.validate_single\")\n : t(\"jdi.document_upload.validate_multiple\");\n };\n // Ajout de logs pour le débogage\n useEffect(() => {\n // Vérifier si le document type est valide\n if (!documentType) {\n console.error(\"JDIDocumentUpload: documentType is missing or invalid\", {\n documentType,\n documentTypeId,\n });\n }\n }, [documentType, documentTypeId, documentLabel]);\n\n // Store File objects instead of base64 strings\n // initialFront/initialBack permettent de pré-remplir en cas de retry (ex: erreur 2.5)\n const [frontFile, setFrontFile] = useState<File | null>(null);\n const [backFile, setBackFile] = useState<File | null>(null);\n const [frontPreview, setFrontPreview] = useState<string | null>(initialFront ?? null);\n const [backPreview, setBackPreview] = useState<string | null>(initialBack ?? null);\n // Indique que le recto/verso vient d'un dépôt précédent (pas un File local)\n const [isFrontFromInitial, setIsFrontFromInitial] = useState<boolean>(!!initialFront);\n const [isBackFromInitial, setIsBackFromInitial] = useState<boolean>(!!initialBack);\n const [isUploading, setIsUploading] = useState(false);\n const [error, setError] = useState<string>(\"\");\n const [isDragging, setIsDragging] = useState(false);\n\n const frontInputRef = useRef<HTMLInputElement>(null);\n const multipleInputRef = useRef<HTMLInputElement>(null);\n const dropZoneRef = useRef<HTMLDivElement>(null);\n const twoSidesRequired = requiresTwoSides(documentType);\n\n // Nouvelle fonction pour gérer la sélection multiple de fichiers\n const handleMultipleFileChange = async (\n event: React.ChangeEvent<HTMLInputElement>,\n ) => {\n const files = event.target.files;\n if (!files) return;\n\n // Vérifier le nombre de fichiers - maximum 2 fichiers\n if (files.length > 2) {\n setError(t(\"jdi.document_upload.errors.max_files\"));\n return;\n } else if (files.length === 0) {\n setError(t(\"jdi.document_upload.errors.min_files\"));\n return;\n }\n\n setError(\"\");\n setFrontFile(null);\n setBackFile(null);\n setFrontPreview(null);\n setBackPreview(null);\n\n // Traiter chaque fichier\n for (let index = 0; index < files.length; index++) {\n let currentFile = files[index];\n\n try {\n currentFile = await convertFileToSupportedFormat(currentFile);\n } catch (conversionError) {\n console.error(\n \"handleMultipleFileChange: HEIC conversion failed\",\n conversionError,\n );\n setError(\n conversionError instanceof Error\n ? conversionError.message\n : t(\"jdi.document_upload.errors.heic_unsupported\"),\n );\n event.target.value = \"\";\n if (multipleInputRef.current) {\n multipleInputRef.current.value = \"\";\n }\n return;\n }\n\n // Valider le type de fichier\n if (!isValidFileType(currentFile)) {\n setError(\n t(\"jdi.document_upload.errors.invalid_file_type_indexed\", {\n index: index + 1,\n }),\n );\n event.target.value = \"\";\n if (multipleInputRef.current) {\n multipleInputRef.current.value = \"\";\n }\n return;\n }\n\n // Valider la taille du fichier\n if (!isValidFileSize(currentFile)) {\n setError(\n t(\"jdi.document_upload.errors.file_too_large_indexed\", {\n index: index + 1,\n }),\n );\n event.target.value = \"\";\n if (multipleInputRef.current) {\n multipleInputRef.current.value = \"\";\n }\n return;\n }\n\n if (index === 0) {\n // Premier fichier = recto\n setFrontFile(currentFile);\n } else if (index === 1 && twoSidesRequired) {\n // Deuxième fichier = verso (seulement si nécessaire)\n setBackFile(currentFile);\n }\n\n // Store File object and create preview\n const reader = new FileReader();\n reader.onload = (e) => {\n const result = e.target?.result as string;\n\n if (index === 0) {\n setFrontPreview(result);\n } else if (index === 1 && twoSidesRequired) {\n setBackPreview(result);\n }\n };\n reader.readAsDataURL(currentFile);\n }\n };\n\n const handleFileChange = async (\n event: React.ChangeEvent<HTMLInputElement>,\n side: \"front\" | \"back\",\n ) => {\n const file = event.target.files?.[0];\n if (!file) return;\n\n let processedFile = file;\n try {\n processedFile = await convertFileToSupportedFormat(file);\n } catch (conversionError) {\n console.error(\n \"handleFileChange: HEIC conversion failed\",\n conversionError,\n );\n setError(\n conversionError instanceof Error\n ? conversionError.message\n : t(\"jdi.document_upload.errors.heic_unsupported\"),\n );\n event.target.value = \"\";\n if (side === \"front\" && frontInputRef.current) {\n frontInputRef.current.value = \"\";\n }\n return;\n }\n\n // Validate file type\n if (!isValidFileType(processedFile)) {\n setError(t(\"jdi.document_upload.errors.invalid_file_type\"));\n event.target.value = \"\";\n return;\n }\n\n // Validate file size (max 10MB)\n if (!isValidFileSize(processedFile)) {\n setError(t(\"jdi.document_upload.errors.file_too_large\"));\n event.target.value = \"\";\n return;\n }\n\n setError(\"\");\n\n // Store File object and create preview\n const reader = new FileReader();\n reader.onload = (e) => {\n const result = e.target?.result as string;\n\n if (side === \"front\") {\n setFrontFile(processedFile);\n setFrontPreview(result);\n setIsFrontFromInitial(false);\n } else {\n setBackFile(processedFile);\n setBackPreview(result);\n setIsBackFromInitial(false);\n }\n };\n reader.readAsDataURL(processedFile);\n };\n\n const handleUpload = async () => {\n // Clear previous errors\n setError(\"\");\n\n // Validation : recto obligatoire (soit un File local, soit une valeur initiale)\n if (!frontFile && !isFrontFromInitial) {\n const errorKey =\n documentTypeId === \"jdd\"\n ? \"jdi.document_upload.errors.add_photo_jdd\"\n : documentTypeId === \"income-proof\"\n ? \"jdi.document_upload.errors.add_photo_income_proof\"\n : \"jdi.document_upload.errors.add_photo_identity\";\n\n setError(t(errorKey));\n return;\n }\n\n // Note: For two-sided documents, the back side is no longer mandatory\n // The user can choose to upload only the front side\n\n setIsUploading(true);\n\n try {\n // Recto : soit conversion d'un File, soit réutilisation de la base64 initiale\n let frontBase64: string;\n if (frontFile) {\n frontBase64 = await fileToBase64(frontFile);\n if (!isValidBase64Data(frontBase64)) {\n setError(t(\"jdi.document_upload.errors.front_corrupted\"));\n setIsUploading(false);\n return;\n }\n } else {\n // isFrontFromInitial === true : on réutilise la valeur initiale\n frontBase64 = initialFront!;\n }\n\n let backBase64: string | null = null;\n if (twoSidesRequired) {\n if (backFile) {\n backBase64 = await fileToBase64(backFile);\n if (!isValidBase64Data(backBase64)) {\n setError(t(\"jdi.document_upload.errors.back_corrupted\"));\n setIsUploading(false);\n return;\n }\n } else if (isBackFromInitial) {\n // On réutilise le verso initial\n backBase64 = initialBack!;\n }\n }\n\n const files = {\n front: frontBase64,\n back: twoSidesRequired ? backBase64 : null,\n };\n\n onUpload(files);\n } catch (err) {\n console.error(\"JDIDocumentUpload: Upload error:\", err);\n setError(t(\"jdi.document_upload.errors.upload_error\"));\n setIsUploading(false);\n }\n };\n\n const removeImage = (side: \"front\" | \"back\") => {\n if (side === \"front\") {\n setFrontFile(null);\n setFrontPreview(null);\n setIsFrontFromInitial(false);\n if (frontInputRef.current) frontInputRef.current.value = \"\";\n } else {\n setBackFile(null);\n setBackPreview(null);\n setIsBackFromInitial(false);\n }\n setError(\"\");\n };\n\n const removeAllImages = () => {\n setFrontFile(null);\n setBackFile(null);\n setFrontPreview(null);\n setBackPreview(null);\n setIsFrontFromInitial(false);\n setIsBackFromInitial(false);\n if (frontInputRef.current) frontInputRef.current.value = \"\";\n if (multipleInputRef.current) multipleInputRef.current.value = \"\";\n setError(\"\");\n };\n\n // Drag and Drop handlers\n const handleDragEnter = (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragging(true);\n };\n\n const handleDragLeave = (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n\n // Only set isDragging to false if we're leaving the drop zone entirely\n if (\n dropZoneRef.current &&\n !dropZoneRef.current.contains(e.relatedTarget as Node)\n ) {\n setIsDragging(false);\n }\n };\n\n const handleDragOver = (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n };\n\n const handleDrop = async (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragging(false);\n\n const droppedFiles = e.dataTransfer.files;\n if (!droppedFiles || droppedFiles.length === 0) return;\n\n // Vérifier le nombre de fichiers\n if (droppedFiles.length > 2) {\n setError(t(\"jdi.document_upload.errors.max_files\"));\n return;\n }\n\n // Détermine si on est en mode \"ajout au verso\" :\n // - 1 seul fichier déposé\n // - document recto/verso requis\n // - recto déjà présent via un dépôt utilisateur (pas uniquement via initialFront)\n // - verso pas encore présent\n const hasFrontFromUser = !!(frontFile || (!isFrontFromInitial && frontPreview));\n const hasBack = !!(backFile || isBackFromInitial || backPreview);\n const isAddingVerso =\n droppedFiles.length === 1 && twoSidesRequired && hasFrontFromUser && !hasBack;\n\n // Si on n'est pas en mode ajout verso, on repart de zéro\n if (!isAddingVerso) {\n setFrontFile(null);\n setBackFile(null);\n setFrontPreview(null);\n setBackPreview(null);\n setIsFrontFromInitial(false);\n setIsBackFromInitial(false);\n }\n\n setError(\"\");\n\n // Traiter chaque fichier\n for (let index = 0; index < droppedFiles.length; index++) {\n let currentFile = droppedFiles[index];\n\n try {\n currentFile = await convertFileToSupportedFormat(currentFile);\n } catch (conversionError) {\n console.error(\"handleDrop: HEIC conversion failed\", conversionError);\n setError(\n conversionError instanceof Error\n ? conversionError.message\n : t(\"jdi.document_upload.errors.heic_unsupported\"),\n );\n return;\n }\n\n // Valider le type de fichier\n if (!isValidFileType(currentFile)) {\n setError(\n t(\"jdi.document_upload.errors.invalid_file_type_indexed\", {\n index: index + 1,\n }),\n );\n return;\n }\n\n // Valider la taille du fichier\n if (!isValidFileSize(currentFile)) {\n setError(\n t(\"jdi.document_upload.errors.file_too_large_indexed\", {\n index: index + 1,\n }),\n );\n return;\n }\n\n // En mode ajout verso : le fichier unique devient le verso\n // Sinon : index 0 = recto, index 1 = verso\n const isVersoSlot = isAddingVerso || (index === 1 && twoSidesRequired);\n\n if (!isVersoSlot) {\n setFrontFile(currentFile);\n } else if (twoSidesRequired) {\n setBackFile(currentFile);\n }\n\n // Store File object and create preview\n const reader = new FileReader();\n reader.onload = (ev) => {\n const result = ev.target?.result as string;\n if (!isVersoSlot) {\n setFrontPreview(result);\n } else if (twoSidesRequired) {\n setBackPreview(result);\n }\n };\n reader.readAsDataURL(currentFile);\n }\n };\n\n return (\n <MobilePageLayout\n contentClassName=\"h-full\"\n footer={\n <PageActions\n primary={\n <Button\n onClick={handleUpload}\n disabled={(!frontFile && !isFrontFromInitial) || isUploading}\n >\n {getValidateButtonText()}\n </Button>\n }\n secondary={\n <Button variant=\"secondary\" onClick={onBack} disabled={isUploading}>\n {t(\"jdi.document_upload.back\")}\n </Button>\n }\n />\n }\n >\n {/* Main content */}\n <div className=\"flex-1 flex items-start justify-center md:items-center p-4\">\n <div className=\"w-full max-w-lg\">\n {/* Header */}\n <div className=\"text-center mb-8\">\n <h1 className=\"text-2xl md:text-3xl font-bold text-gray-900 mb-2\">\n {getDropZoneText()}\n </h1>\n <p className=\"text-gray-600\">{getUploadInstruction()}</p>\n </div>\n\n {/* Upload Card */}\n <Card\n ref={dropZoneRef}\n className={`border-2 border-dashed ${\n isDragging\n ? \"border-teal-500 bg-teal-100/50\"\n : \"border-teal-300 bg-teal-50/30\"\n } p-8 mb-6 transition-colors`}\n onDragEnter={handleDragEnter}\n onDragLeave={handleDragLeave}\n onDragOver={handleDragOver}\n onDrop={handleDrop}\n >\n <div className=\"text-center space-y-6\">\n {!frontPreview ? (\n <>\n <h3 className=\"text-lg font-semibold text-gray-900 mb-4\">\n {t(\"documentTypes.\" + documentType)}\n </h3>\n\n <div className=\"flex justify-center w-full\">\n <Button\n onClick={() => frontInputRef.current?.click()}\n className=\"border border-teal-300 text-teal-600 bg-transparent hover:bg-teal-50 px-4 py-2 rounded-lg font-medium text-sm mx-auto flex items-center\"\n disabled={isUploading}\n >\n <span>{t(\"jdi.document_upload.add_file\")}</span>\n </Button>\n </div>\n\n <p className=\"text-sm text-gray-500 italic\">\n {t(\n \"jdi.document_upload.drag_drop_hint\",\n \"ou glissez-déposez vos fichiers ici\",\n )}\n </p>\n\n <div className=\"text-sm text-gray-600 space-y-1\">\n <p>{t(\"jdi.document_upload.accepted_formats\")}</p>\n <p>\n {twoSidesRequired\n ? frontPreview\n ? t(\"jdi.document_upload.add_back_side\")\n : t(\"jdi.document_upload.multiple_files_info\")\n : t(\"jdi.document_upload.single_file_info\")}\n </p>\n </div>\n </>\n ) : (\n <div className=\"space-y-4\">\n <h3 className=\"text-lg font-semibold text-gray-900\">\n {twoSidesRequired && frontPreview && backPreview\n ? t(\"jdi.document_upload.documents_added\")\n : t(\"jdi.document_upload.document_added\")}\n </h3>\n\n {/* Preview du document recto */}\n <div className=\"bg-white border border-gray-200 rounded-lg p-4\">\n <div className=\"mb-3\">\n <p className=\"text-sm font-medium text-gray-900 mb-1\">\n {twoSidesRequired && backPreview\n ? t(\"jdi.document_upload.front_side\")\n : t(\"documentTypes.\" + documentType)}\n </p>\n <p className=\"text-xs text-gray-500\">\n {isPDF(frontFile)\n ? t(\"jdi.document_upload.pdf_preview\")\n : t(\"jdi.document_upload.image_preview\")}\n </p>\n </div>\n {isPDF(frontFile) ? (\n <PDFPreview src={frontPreview} className=\"mb-3\" />\n ) : (\n <img\n src={frontPreview || \"/placeholder.svg\"}\n alt=\"Document\"\n className=\"w-full h-48 object-contain bg-gray-50 rounded-lg border mb-3\"\n />\n )}\n <div className=\"flex justify-end gap-2\">\n {twoSidesRequired && frontPreview && backPreview ? (\n <button\n onClick={removeAllImages}\n className=\"text-red-500 hover:text-red-700 p-1 text-sm\"\n disabled={isUploading}\n >\n {t(\"jdi.document_upload.restart\")}\n </button>\n ) : (\n <>\n <button\n onClick={() => frontInputRef.current?.click()}\n className=\"text-teal-600 hover:text-teal-700 p-1 text-sm\"\n disabled={isUploading}\n title=\"Changer le document\"\n >\n {t(\"jdi.document_upload.change\")}\n </button>\n <button\n onClick={() => removeImage(\"front\")}\n className=\"text-red-500 hover:text-red-700 p-1\"\n disabled={isUploading}\n title=\"Supprimer le document\"\n >\n <svg\n className=\"h-5 w-5\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16\"\n />\n </svg>\n </button>\n </>\n )}\n </div>\n </div>\n\n {/* Preview du document verso (si présent) */}\n {twoSidesRequired && backPreview && (\n <div className=\"bg-white border border-gray-200 rounded-lg p-4\">\n <div className=\"mb-3\">\n <p className=\"text-sm font-medium text-gray-900 mb-1\">\n {t(\"jdi.document_upload.back_side\")}\n </p>\n <p className=\"text-xs text-gray-500\">\n {isPDF(frontFile)\n ? t(\"jdi.document_upload.pdf_preview\")\n : t(\"jdi.document_upload.image_preview\")}\n </p>\n </div>\n {isPDF(backFile) ? (\n <PDFPreview src={backPreview || \"\"} className=\"mb-3\" />\n ) : (\n <img\n src={backPreview || \"\"}\n alt=\"Verso\"\n className=\"w-full h-48 object-contain bg-gray-50 rounded-lg border mb-3\"\n />\n )}\n </div>\n )}\n\n {/* Bouton pour ajouter le verso si c'est un document recto/verso et qu'on n'a pas encore le verso */}\n {twoSidesRequired && !backPreview && (\n <div className=\"flex justify-center mt-4\">\n <Button\n onClick={() => {\n const input = document.createElement(\"input\");\n input.type = \"file\";\n input.accept = \"image/*,.pdf\";\n input.onchange = (e) =>\n handleFileChange(e as any, \"back\");\n input.click();\n }}\n className=\"border border-teal-300 text-teal-600 bg-transparent hover:bg-teal-50 px-4 py-2 rounded-lg font-medium text-sm flex items-center\"\n disabled={isUploading}\n >\n <span>{t(\"jdi.document_upload.add_back\")}</span>\n </Button>\n </div>\n )}\n\n <div className=\"text-sm text-gray-600\">\n <p>\n {twoSidesRequired && backPreview\n ? t(\"jdi.document_upload.documents_ready\")\n : t(\"jdi.document_upload.document_ready\")}\n </p>\n </div>\n </div>\n )}\n </div>\n </Card>\n\n {/* Input pour un seul fichier */}\n <input\n ref={frontInputRef}\n type=\"file\"\n accept=\"image/*,.pdf\"\n onChange={(e) => handleFileChange(e, \"front\")}\n className=\"hidden\"\n />\n\n {/* Input pour plusieurs fichiers (recto/verso) */}\n <input\n ref={multipleInputRef}\n type=\"file\"\n accept=\"image/*,.pdf\"\n multiple={twoSidesRequired}\n onChange={handleMultipleFileChange}\n className=\"hidden\"\n />\n\n {/* Error message */}\n {error && (\n <div className=\"bg-red-50 border border-red-200 rounded-lg p-4 mb-6\">\n <p className=\"text-sm text-red-600 flex items-center\">\n <span className=\"mr-2\">⚠</span>\n {error}\n </p>\n </div>\n )}\n </div>\n </div>\n </MobilePageLayout>\n );\n};\n\nexport default JDIDocumentUpload;\n"],"names":["useI18n","useEffect","useState","useRef","requiresTwoSides","__awaiter","convertFileToSupportedFormat","isValidFileType","isValidFileSize","fileToBase64","isValidBase64Data","_jsx","MobilePageLayout","PageActions","Button","_jsxs","Card","_Fragment","isPDF","PDFPreview"],"mappings":";;;;;;;;;;;;;;;;AA6BA,IAAM,iBAAiB,GAAG,UAAC,EAQF,EAAA;QAPvB,YAAY,GAAA,EAAA,CAAA,YAAA,EACZ,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,cAAc,GAAA,EAAA,CAAA,cAAA,EACd,aAAa,GAAA,EAAA,CAAA,aAAA,EACb,EAAA,GAAA,EAAA,CAAA,YAAmB,EAAnB,YAAY,GAAA,EAAA,KAAA,MAAA,GAAG,IAAI,GAAA,EAAA,EACnB,EAAA,GAAA,EAAA,CAAA,WAAkB,EAAlB,WAAW,GAAA,EAAA,KAAA,MAAA,GAAG,IAAI,GAAA,EAAA;AAEV,IAAA,IAAA,CAAC,GAAKA,eAAO,EAAE,EAAd;;AAGT,IAAA,IAAM,eAAe,GAAG,YAAA;QACtB,OAAO,CAAC,CAAC,+BAA+B,EAAE;AACxC,YAAA,QAAQ,EAAE,CAAC,CAAC,gBAAgB,GAAG,YAAY,CAAC;AAC7C,SAAA,CAAC;AACJ,IAAA,CAAC;AAED,IAAA,IAAM,oBAAoB,GAAG,YAAA;QAC3B,QAAQ,cAAc;AACpB,YAAA,KAAK,KAAK;AACR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CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,uBAAuB,EAAA,QAAA,EACpCA,cAAA,CAAA,GAAA,EAAA,EAAA,QAAA,EACG,gBAAgB,IAAI;AACnB,kDAAE,CAAC,CAAC,qCAAqC;kDACvC,CAAC,CAAC,oCAAoC,CAAC,EAAA,CACzC,EAAA,CACA,IACF,CACP,EAAA,CACG,GACD,EAGPA,cAAA,CAAA,OAAA,EAAA,EACE,GAAG,EAAE,aAAa,EAClB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,QAAQ,EAAE,UAAC,CAAC,IAAK,OAAA,gBAAgB,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA,CAA5B,CAA4B,EAC7C,SAAS,EAAC,QAAQ,EAAA,CAClB,EAGFA,cAAA,CAAA,OAAA,EAAA,EACE,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,wBAAwB,EAClC,SAAS,EAAC,QAAQ,EAAA,CAClB,EAGD,KAAK,KACJA,wBAAK,SAAS,EAAC,qDAAqD,EAAA,QAAA,EAClEI,eAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,wCAAwC,EAAA,QAAA,EAAA,CACnDJ,cAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,MAAM,EAAA,QAAA,EAAA,QAAA,EAAA,CAAS,EAC9B,KAAK,CAAA,EAAA,CACJ,EAAA,CACA,CACP,CAAA,EAAA,CACG,EAAA,CACF,EAAA,CACW;AAEvB;;;;"}
|
|
1
|
+
{"version":3,"file":"JDIDocumentUpload.js","sources":["../../../../../src/components/jdi/JDIDocumentUpload.tsx"],"sourcesContent":["import { useState, useRef, useEffect } from \"react\";\n\nimport Button from \"../ui/Button\";\nimport PageActions from \"../ui/PageActions\";\nimport { Card } from \"../ui/Card\";\nimport PDFPreview from \"../ui/PDFPreview\";\nimport type { onUploadFiles } from \"../../types/uploadFiles\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport {\n convertFileToSupportedFormat,\n fileToBase64,\n isPDF,\n isValidFileType,\n isValidFileSize,\n isValidBase64Data,\n} from \"../../utils/fileConverter\";\nimport { requiresTwoSides } from \"../../utils/documentLabels\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\nimport {\n logDocumentLoaded,\n logDocumentsValidated,\n} from \"../../services/auditTrailService\";\n\ninterface JDIDocumentUploadProps {\n documentType: string;\n onUpload: (files: onUploadFiles) => void;\n onBack: () => void;\n documentTypeId?: string; // Pour identifier des types spécifiques comme jdd ou income-proof\n documentLabel?: string; // Le label lisible du document sélectionné (ex: \"Carte nationale d'identité\")\n initialFront?: string | null; // Base64 du recto déjà déposé (ex: après erreur 2.5)\n initialBack?: string | null; // Base64 du verso déjà déposé (ex: après erreur 2.5)\n sessionId?: string;\n}\n\nconst JDIDocumentUpload = ({\n documentType,\n onUpload,\n onBack,\n documentTypeId,\n documentLabel,\n initialFront = null,\n initialBack = null,\n sessionId,\n}: JDIDocumentUploadProps) => {\n const { t } = useI18n();\n\n // Helper functions for conditional text\n const getDropZoneText = () => {\n return t(\"jdi.document_upload.drop_zone\", {\n document: t(\"documentTypes.\" + documentType),\n });\n };\n\n const getUploadInstruction = () => {\n switch (documentTypeId) {\n case \"jdd\":\n return t(\"jdi.document_upload.upload_jdd\");\n case \"income-proof\":\n return t(\"jdi.document_upload.upload_income_proof\");\n default:\n return t(\"jdi.document_upload.upload_identity\", {\n document: t(\"documentTypes.\" + documentType),\n });\n }\n };\n\n const getValidateButtonText = () => {\n if (isUploading) {\n return t(\"jdi.document_upload.uploading\");\n }\n return documentTypeId === \"jdd\" || documentTypeId === \"income-proof\"\n ? t(\"jdi.document_upload.validate_single\")\n : t(\"jdi.document_upload.validate_multiple\");\n };\n // Ajout de logs pour le débogage\n useEffect(() => {\n // Vérifier si le document type est valide\n if (!documentType) {\n console.error(\"JDIDocumentUpload: documentType is missing or invalid\", {\n documentType,\n documentTypeId,\n });\n }\n }, [documentType, documentTypeId, documentLabel]);\n\n // Store File objects instead of base64 strings\n // initialFront/initialBack permettent de pré-remplir en cas de retry (ex: erreur 2.5)\n const [frontFile, setFrontFile] = useState<File | null>(null);\n const [backFile, setBackFile] = useState<File | null>(null);\n const [frontPreview, setFrontPreview] = useState<string | null>(initialFront ?? null);\n const [backPreview, setBackPreview] = useState<string | null>(initialBack ?? null);\n // Indique que le recto/verso vient d'un dépôt précédent (pas un File local)\n const [isFrontFromInitial, setIsFrontFromInitial] = useState<boolean>(!!initialFront);\n const [isBackFromInitial, setIsBackFromInitial] = useState<boolean>(!!initialBack);\n const [isUploading, setIsUploading] = useState(false);\n const [error, setError] = useState<string>(\"\");\n const [isDragging, setIsDragging] = useState(false);\n\n const frontInputRef = useRef<HTMLInputElement>(null);\n const multipleInputRef = useRef<HTMLInputElement>(null);\n const dropZoneRef = useRef<HTMLDivElement>(null);\n const twoSidesRequired = requiresTwoSides(documentType);\n\n // Nouvelle fonction pour gérer la sélection multiple de fichiers\n const handleMultipleFileChange = async (\n event: React.ChangeEvent<HTMLInputElement>,\n ) => {\n const files = event.target.files;\n if (!files) return;\n\n // Vérifier le nombre de fichiers - maximum 2 fichiers\n if (files.length > 2) {\n setError(t(\"jdi.document_upload.errors.max_files\"));\n return;\n } else if (files.length === 0) {\n setError(t(\"jdi.document_upload.errors.min_files\"));\n return;\n }\n\n setError(\"\");\n setFrontFile(null);\n setBackFile(null);\n setFrontPreview(null);\n setBackPreview(null);\n\n // Traiter chaque fichier\n for (let index = 0; index < files.length; index++) {\n let currentFile = files[index];\n\n try {\n currentFile = await convertFileToSupportedFormat(currentFile);\n } catch (conversionError) {\n console.error(\n \"handleMultipleFileChange: HEIC conversion failed\",\n conversionError,\n );\n setError(\n conversionError instanceof Error\n ? conversionError.message\n : t(\"jdi.document_upload.errors.heic_unsupported\"),\n );\n event.target.value = \"\";\n if (multipleInputRef.current) {\n multipleInputRef.current.value = \"\";\n }\n return;\n }\n\n // Valider le type de fichier\n if (!isValidFileType(currentFile)) {\n setError(\n t(\"jdi.document_upload.errors.invalid_file_type_indexed\", {\n index: index + 1,\n }),\n );\n event.target.value = \"\";\n if (multipleInputRef.current) {\n multipleInputRef.current.value = \"\";\n }\n return;\n }\n\n // Valider la taille du fichier\n if (!isValidFileSize(currentFile)) {\n setError(\n t(\"jdi.document_upload.errors.file_too_large_indexed\", {\n index: index + 1,\n }),\n );\n event.target.value = \"\";\n if (multipleInputRef.current) {\n multipleInputRef.current.value = \"\";\n }\n return;\n }\n\n if (index === 0) {\n // Premier fichier = recto\n setFrontFile(currentFile);\n } else if (index === 1 && twoSidesRequired) {\n // Deuxième fichier = verso (seulement si nécessaire)\n setBackFile(currentFile);\n }\n\n // Store File object and create preview\n const reader = new FileReader();\n reader.onload = (e) => {\n const result = e.target?.result as string;\n\n if (index === 0) {\n setFrontPreview(result);\n } else if (index === 1 && twoSidesRequired) {\n setBackPreview(result);\n }\n };\n reader.readAsDataURL(currentFile);\n }\n };\n\n const handleFileChange = async (\n event: React.ChangeEvent<HTMLInputElement>,\n side: \"front\" | \"back\",\n ) => {\n const file = event.target.files?.[0];\n if (!file) return;\n\n let processedFile = file;\n try {\n processedFile = await convertFileToSupportedFormat(file);\n } catch (conversionError) {\n console.error(\n \"handleFileChange: HEIC conversion failed\",\n conversionError,\n );\n setError(\n conversionError instanceof Error\n ? conversionError.message\n : t(\"jdi.document_upload.errors.heic_unsupported\"),\n );\n event.target.value = \"\";\n if (side === \"front\" && frontInputRef.current) {\n frontInputRef.current.value = \"\";\n }\n return;\n }\n\n // Validate file type\n if (!isValidFileType(processedFile)) {\n setError(t(\"jdi.document_upload.errors.invalid_file_type\"));\n event.target.value = \"\";\n return;\n }\n\n // Validate file size (max 10MB)\n if (!isValidFileSize(processedFile)) {\n setError(t(\"jdi.document_upload.errors.file_too_large\"));\n event.target.value = \"\";\n return;\n }\n\n setError(\"\");\n\n // Store File object and create preview\n const reader = new FileReader();\n reader.onload = (e) => {\n const result = e.target?.result as string;\n\n if (side === \"front\") {\n setFrontFile(processedFile);\n setFrontPreview(result);\n setIsFrontFromInitial(false);\n } else {\n setBackFile(processedFile);\n setBackPreview(result);\n setIsBackFromInitial(false);\n }\n };\n reader.readAsDataURL(processedFile);\n };\n\n const handleUpload = async () => {\n // Clear previous errors\n setError(\"\");\n\n // Validation : recto obligatoire (soit un File local, soit une valeur initiale)\n if (!frontFile && !isFrontFromInitial) {\n const errorKey =\n documentTypeId === \"jdd\"\n ? \"jdi.document_upload.errors.add_photo_jdd\"\n : documentTypeId === \"income-proof\"\n ? \"jdi.document_upload.errors.add_photo_income_proof\"\n : \"jdi.document_upload.errors.add_photo_identity\";\n\n setError(t(errorKey));\n return;\n }\n\n // Note: For two-sided documents, the back side is no longer mandatory\n // The user can choose to upload only the front side\n\n setIsUploading(true);\n\n try {\n // Recto : soit conversion d'un File, soit réutilisation de la base64 initiale\n let frontBase64: string;\n if (frontFile) {\n frontBase64 = await fileToBase64(frontFile);\n if (!isValidBase64Data(frontBase64)) {\n setError(t(\"jdi.document_upload.errors.front_corrupted\"));\n setIsUploading(false);\n return;\n }\n } else {\n // isFrontFromInitial === true : on réutilise la valeur initiale\n frontBase64 = initialFront!;\n }\n\n let backBase64: string | null = null;\n if (twoSidesRequired) {\n if (backFile) {\n backBase64 = await fileToBase64(backFile);\n if (!isValidBase64Data(backBase64)) {\n setError(t(\"jdi.document_upload.errors.back_corrupted\"));\n setIsUploading(false);\n return;\n }\n } else if (isBackFromInitial) {\n // On réutilise le verso initial\n backBase64 = initialBack!;\n }\n }\n\n const files = {\n front: frontBase64,\n back: twoSidesRequired ? backBase64 : null,\n };\n\n onUpload(files);\n } catch (err) {\n console.error(\"JDIDocumentUpload: Upload error:\", err);\n setError(t(\"jdi.document_upload.errors.upload_error\"));\n setIsUploading(false);\n }\n };\n\n const removeImage = (side: \"front\" | \"back\") => {\n if (side === \"front\") {\n setFrontFile(null);\n setFrontPreview(null);\n setIsFrontFromInitial(false);\n if (frontInputRef.current) frontInputRef.current.value = \"\";\n } else {\n setBackFile(null);\n setBackPreview(null);\n setIsBackFromInitial(false);\n }\n setError(\"\");\n };\n\n const removeAllImages = () => {\n setFrontFile(null);\n setBackFile(null);\n setFrontPreview(null);\n setBackPreview(null);\n setIsFrontFromInitial(false);\n setIsBackFromInitial(false);\n if (frontInputRef.current) frontInputRef.current.value = \"\";\n if (multipleInputRef.current) multipleInputRef.current.value = \"\";\n setError(\"\");\n };\n\n // Drag and Drop handlers\n const handleDragEnter = (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragging(true);\n };\n\n const handleDragLeave = (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n\n // Only set isDragging to false if we're leaving the drop zone entirely\n if (\n dropZoneRef.current &&\n !dropZoneRef.current.contains(e.relatedTarget as Node)\n ) {\n setIsDragging(false);\n }\n };\n\n const handleDragOver = (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n };\n\n const handleDrop = async (e: React.DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragging(false);\n\n const droppedFiles = e.dataTransfer.files;\n if (!droppedFiles || droppedFiles.length === 0) return;\n\n // Vérifier le nombre de fichiers\n if (droppedFiles.length > 2) {\n setError(t(\"jdi.document_upload.errors.max_files\"));\n return;\n }\n\n // Détermine si on est en mode \"ajout au verso\" :\n // - 1 seul fichier déposé\n // - document recto/verso requis\n // - recto déjà présent via un dépôt utilisateur (pas uniquement via initialFront)\n // - verso pas encore présent\n const hasFrontFromUser = !!(frontFile || (!isFrontFromInitial && frontPreview));\n const hasBack = !!(backFile || isBackFromInitial || backPreview);\n const isAddingVerso =\n droppedFiles.length === 1 && twoSidesRequired && hasFrontFromUser && !hasBack;\n\n // Si on n'est pas en mode ajout verso, on repart de zéro\n if (!isAddingVerso) {\n setFrontFile(null);\n setBackFile(null);\n setFrontPreview(null);\n setBackPreview(null);\n setIsFrontFromInitial(false);\n setIsBackFromInitial(false);\n }\n\n setError(\"\");\n\n // Traiter chaque fichier\n for (let index = 0; index < droppedFiles.length; index++) {\n let currentFile = droppedFiles[index];\n\n try {\n currentFile = await convertFileToSupportedFormat(currentFile);\n } catch (conversionError) {\n console.error(\"handleDrop: HEIC conversion failed\", conversionError);\n setError(\n conversionError instanceof Error\n ? conversionError.message\n : t(\"jdi.document_upload.errors.heic_unsupported\"),\n );\n return;\n }\n\n // Valider le type de fichier\n if (!isValidFileType(currentFile)) {\n setError(\n t(\"jdi.document_upload.errors.invalid_file_type_indexed\", {\n index: index + 1,\n }),\n );\n return;\n }\n\n // Valider la taille du fichier\n if (!isValidFileSize(currentFile)) {\n setError(\n t(\"jdi.document_upload.errors.file_too_large_indexed\", {\n index: index + 1,\n }),\n );\n return;\n }\n\n // En mode ajout verso : le fichier unique devient le verso\n // Sinon : index 0 = recto, index 1 = verso\n const isVersoSlot = isAddingVerso || (index === 1 && twoSidesRequired);\n\n if (!isVersoSlot) {\n setFrontFile(currentFile);\n } else if (twoSidesRequired) {\n setBackFile(currentFile);\n }\n\n // Store File object and create preview\n const reader = new FileReader();\n reader.onload = (ev) => {\n const result = ev.target?.result as string;\n if (!isVersoSlot) {\n setFrontPreview(result);\n } else if (twoSidesRequired) {\n setBackPreview(result);\n }\n };\n reader.readAsDataURL(currentFile);\n }\n };\n\n return (\n <MobilePageLayout\n contentClassName=\"h-full\"\n footer={\n <PageActions\n primary={\n <Button\n onClick={handleUpload}\n disabled={(!frontFile && !isFrontFromInitial) || isUploading}\n >\n {getValidateButtonText()}\n </Button>\n }\n secondary={\n <Button variant=\"secondary\" onClick={onBack} disabled={isUploading}>\n {t(\"jdi.document_upload.back\")}\n </Button>\n }\n />\n }\n >\n {/* Main content */}\n <div className=\"flex-1 flex items-start justify-center md:items-center p-4\">\n <div className=\"w-full max-w-lg\">\n {/* Header */}\n <div className=\"text-center mb-8\">\n <h1 className=\"text-2xl md:text-3xl font-bold text-gray-900 mb-2\">\n {getDropZoneText()}\n </h1>\n <p className=\"text-gray-600\">{getUploadInstruction()}</p>\n </div>\n\n {/* Upload Card */}\n <Card\n ref={dropZoneRef}\n className={`border-2 border-dashed ${\n isDragging\n ? \"border-teal-500 bg-teal-100/50\"\n : \"border-teal-300 bg-teal-50/30\"\n } p-8 mb-6 transition-colors`}\n onDragEnter={handleDragEnter}\n onDragLeave={handleDragLeave}\n onDragOver={handleDragOver}\n onDrop={handleDrop}\n >\n <div className=\"text-center space-y-6\">\n {!frontPreview ? (\n <>\n <h3 className=\"text-lg font-semibold text-gray-900 mb-4\">\n {t(\"documentTypes.\" + documentType)}\n </h3>\n\n <div className=\"flex justify-center w-full\">\n <Button\n onClick={() => frontInputRef.current?.click()}\n className=\"border border-teal-300 text-teal-600 bg-transparent hover:bg-teal-50 px-4 py-2 rounded-lg font-medium text-sm mx-auto flex items-center\"\n disabled={isUploading}\n >\n <span>{t(\"jdi.document_upload.add_file\")}</span>\n </Button>\n </div>\n\n <p className=\"text-sm text-gray-500 italic\">\n {t(\n \"jdi.document_upload.drag_drop_hint\",\n \"ou glissez-déposez vos fichiers ici\",\n )}\n </p>\n\n <div className=\"text-sm text-gray-600 space-y-1\">\n <p>{t(\"jdi.document_upload.accepted_formats\")}</p>\n <p>\n {twoSidesRequired\n ? frontPreview\n ? t(\"jdi.document_upload.add_back_side\")\n : t(\"jdi.document_upload.multiple_files_info\")\n : t(\"jdi.document_upload.single_file_info\")}\n </p>\n </div>\n </>\n ) : (\n <div className=\"space-y-4\">\n <h3 className=\"text-lg font-semibold text-gray-900\">\n {twoSidesRequired && frontPreview && backPreview\n ? t(\"jdi.document_upload.documents_added\")\n : t(\"jdi.document_upload.document_added\")}\n </h3>\n\n {/* Preview du document recto */}\n <div className=\"bg-white border border-gray-200 rounded-lg p-4\">\n <div className=\"mb-3\">\n <p className=\"text-sm font-medium text-gray-900 mb-1\">\n {twoSidesRequired && backPreview\n ? t(\"jdi.document_upload.front_side\")\n : t(\"documentTypes.\" + documentType)}\n </p>\n <p className=\"text-xs text-gray-500\">\n {isPDF(frontFile)\n ? t(\"jdi.document_upload.pdf_preview\")\n : t(\"jdi.document_upload.image_preview\")}\n </p>\n </div>\n {isPDF(frontFile) ? (\n <PDFPreview src={frontPreview} className=\"mb-3\" />\n ) : (\n <img\n src={frontPreview || \"/placeholder.svg\"}\n alt=\"Document\"\n className=\"w-full h-48 object-contain bg-gray-50 rounded-lg border mb-3\"\n />\n )}\n <div className=\"flex justify-end gap-2\">\n {twoSidesRequired && frontPreview && backPreview ? (\n <button\n onClick={removeAllImages}\n className=\"text-red-500 hover:text-red-700 p-1 text-sm\"\n disabled={isUploading}\n >\n {t(\"jdi.document_upload.restart\")}\n </button>\n ) : (\n <>\n <button\n onClick={() => frontInputRef.current?.click()}\n className=\"text-teal-600 hover:text-teal-700 p-1 text-sm\"\n disabled={isUploading}\n title=\"Changer le document\"\n >\n {t(\"jdi.document_upload.change\")}\n </button>\n <button\n onClick={() => removeImage(\"front\")}\n className=\"text-red-500 hover:text-red-700 p-1\"\n disabled={isUploading}\n title=\"Supprimer le document\"\n >\n <svg\n className=\"h-5 w-5\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16\"\n />\n </svg>\n </button>\n </>\n )}\n </div>\n </div>\n\n {/* Preview du document verso (si présent) */}\n {twoSidesRequired && backPreview && (\n <div className=\"bg-white border border-gray-200 rounded-lg p-4\">\n <div className=\"mb-3\">\n <p className=\"text-sm font-medium text-gray-900 mb-1\">\n {t(\"jdi.document_upload.back_side\")}\n </p>\n <p className=\"text-xs text-gray-500\">\n {isPDF(frontFile)\n ? t(\"jdi.document_upload.pdf_preview\")\n : t(\"jdi.document_upload.image_preview\")}\n </p>\n </div>\n {isPDF(backFile) ? (\n <PDFPreview src={backPreview || \"\"} className=\"mb-3\" />\n ) : (\n <img\n src={backPreview || \"\"}\n alt=\"Verso\"\n className=\"w-full h-48 object-contain bg-gray-50 rounded-lg border mb-3\"\n />\n )}\n </div>\n )}\n\n {/* Bouton pour ajouter le verso si c'est un document recto/verso et qu'on n'a pas encore le verso */}\n {twoSidesRequired && !backPreview && (\n <div className=\"flex justify-center mt-4\">\n <Button\n onClick={() => {\n const input = document.createElement(\"input\");\n input.type = \"file\";\n input.accept = \"image/*,.pdf\";\n input.onchange = (e) =>\n handleFileChange(e as any, \"back\");\n input.click();\n }}\n className=\"border border-teal-300 text-teal-600 bg-transparent hover:bg-teal-50 px-4 py-2 rounded-lg font-medium text-sm flex items-center\"\n disabled={isUploading}\n >\n <span>{t(\"jdi.document_upload.add_back\")}</span>\n </Button>\n </div>\n )}\n\n <div className=\"text-sm text-gray-600\">\n <p>\n {twoSidesRequired && backPreview\n ? t(\"jdi.document_upload.documents_ready\")\n : t(\"jdi.document_upload.document_ready\")}\n </p>\n </div>\n </div>\n )}\n </div>\n </Card>\n\n {/* Input pour un seul fichier */}\n <input\n ref={frontInputRef}\n type=\"file\"\n accept=\"image/*,.pdf\"\n onChange={(e) => handleFileChange(e, \"front\")}\n className=\"hidden\"\n />\n\n {/* Input pour plusieurs fichiers (recto/verso) */}\n <input\n ref={multipleInputRef}\n type=\"file\"\n accept=\"image/*,.pdf\"\n multiple={twoSidesRequired}\n onChange={handleMultipleFileChange}\n className=\"hidden\"\n />\n\n {/* Error message */}\n {error && (\n <div className=\"bg-red-50 border border-red-200 rounded-lg p-4 mb-6\">\n <p className=\"text-sm text-red-600 flex items-center\">\n <span className=\"mr-2\">⚠</span>\n {error}\n </p>\n </div>\n )}\n </div>\n </div>\n </MobilePageLayout>\n );\n};\n\nexport default JDIDocumentUpload;\n"],"names":["useI18n","useEffect","useState","useRef","requiresTwoSides","__awaiter","convertFileToSupportedFormat","isValidFileType","isValidFileSize","fileToBase64","isValidBase64Data","_jsx","MobilePageLayout","PageActions","Button","_jsxs","Card","_Fragment","isPDF","PDFPreview"],"mappings":";;;;;;;;;;;;;;;;AAkCA,IAAM,iBAAiB,GAAG,UAAC,EASF,EAAA;AARvB,IAAA,IAAA,YAAY,GAAA,EAAA,CAAA,YAAA,CAAA,CACZ,QAAQ,GAAA,EAAA,CAAA,QAAA,CAAA,CACR,MAAM,GAAA,EAAA,CAAA,MAAA,CAAA,CACN,cAAc,GAAA,EAAA,CAAA,cAAA,CAAA,CACd,aAAa,GAAA,EAAA,CAAA,aAAA,CAAA,CACb,EAAA,GAAA,EAAA,CAAA,YAAmB,CAAA,CAAnB,YAAY,GAAA,EAAA,KAAA,MAAA,GAAG,IAAI,GAAA,EAAA,CAAA,CACnB,EAAA,GAAA,EAAA,CAAA,WAAkB,CAAA,CAAlB,WAAW,GAAA,EAAA,KAAA,MAAA,GAAG,IAAI,GAAA,EAAA,CAAA,CACT,EAAA,CAAA;AAED,IAAA,IAAA,CAAC,GAAKA,eAAO,EAAE,EAAd;;AAGT,IAAA,IAAM,eAAe,GAAG,YAAA;QACtB,OAAO,CAAC,CAAC,+BAA+B,EAAE;AACxC,YAAA,QAAQ,EAAE,CAAC,CAAC,gBAAgB,GAAG,YAAY,CAAC;AAC7C,SAAA,CAAC;AACJ,IAAA,CAAC;AAED,IAAA,IAAM,oBAAoB,GAAG,YAAA;QAC3B,QAAQ,cAAc;AACpB,YAAA,KAAK,KAAK;AACR,gBAAA,OAAO,CAAC,CAAC,gCAAgC,CAAC;AAC5C,YAAA,KAAK,cAAc;AACjB,gBAAA,OAAO,CAAC,CAAC,yCAAyC,CAAC;AACrD,YAAA;gBACE,OAAO,CAAC,CAAC,qCAAqC,EAAE;AAC9C,oBAAA,QAAQ,EAAE,CAAC,CAAC,gBAAgB,GAAG,YAAY,CAAC;A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GACD,EAGPA,cAAA,CAAA,OAAA,EAAA,EACE,GAAG,EAAE,aAAa,EAClB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,QAAQ,EAAE,UAAC,CAAC,IAAK,OAAA,gBAAgB,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA,CAA5B,CAA4B,EAC7C,SAAS,EAAC,QAAQ,EAAA,CAClB,EAGFA,cAAA,CAAA,OAAA,EAAA,EACE,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,wBAAwB,EAClC,SAAS,EAAC,QAAQ,EAAA,CAClB,EAGD,KAAK,KACJA,wBAAK,SAAS,EAAC,qDAAqD,EAAA,QAAA,EAClEI,eAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,wCAAwC,EAAA,QAAA,EAAA,CACnDJ,cAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,MAAM,EAAA,QAAA,EAAA,QAAA,EAAA,CAAS,EAC9B,KAAK,CAAA,EAAA,CACJ,EAAA,CACA,CACP,CAAA,EAAA,CACG,EAAA,CACF,EAAA,CACW;AAEvB;;;;"}
|
|
@@ -20,6 +20,7 @@ var DocumentVideoCapture = require('../document-video/DocumentVideoCapture.js');
|
|
|
20
20
|
var lucideReact = require('lucide-react');
|
|
21
21
|
var DocumentContext = require('../../context/DocumentContext.js');
|
|
22
22
|
var useI18n = require('../../hooks/useI18n.js');
|
|
23
|
+
var auditTrailService = require('../../services/auditTrailService.js');
|
|
23
24
|
var ButtonDesktop = require('../ui/ButtonDesktop.js');
|
|
24
25
|
var Title = require('../ui/Title.js');
|
|
25
26
|
var Subtitle = require('../ui/Subtitle.js');
|
|
@@ -281,6 +282,7 @@ var DocumentCheck = function (_a) {
|
|
|
281
282
|
var _a;
|
|
282
283
|
return (tslib_es6.__assign(tslib_es6.__assign({}, prev), (_a = {}, _a[side] = processedDataUrl_1, _a)));
|
|
283
284
|
});
|
|
285
|
+
auditTrailService.logPhotoCaptured(sessionId, side);
|
|
284
286
|
if (side === "recto") {
|
|
285
287
|
isSingleSided = (selectedDocumentType === null || selectedDocumentType === void 0 ? void 0 : selectedDocumentType.id) === "passport" ||
|
|
286
288
|
(selectedDocumentType === null || selectedDocumentType === void 0 ? void 0 : selectedDocumentType.id) === "pinkDriverLicense";
|
|
@@ -298,6 +300,7 @@ var DocumentCheck = function (_a) {
|
|
|
298
300
|
var _a;
|
|
299
301
|
return (tslib_es6.__assign(tslib_es6.__assign({}, prev), (_a = {}, _a[side] = imageData, _a)));
|
|
300
302
|
});
|
|
303
|
+
auditTrailService.logPhotoCaptured(sessionId, side);
|
|
301
304
|
if (side === "recto") {
|
|
302
305
|
isSingleSided = (selectedDocumentType === null || selectedDocumentType === void 0 ? void 0 : selectedDocumentType.id) === "passport" ||
|
|
303
306
|
(selectedDocumentType === null || selectedDocumentType === void 0 ? void 0 : selectedDocumentType.id) === "pinkDriverLicense";
|
|
@@ -313,6 +316,7 @@ var DocumentCheck = function (_a) {
|
|
|
313
316
|
}); };
|
|
314
317
|
var handlePhotoConfirmation = function () {
|
|
315
318
|
if (capturedImages.recto) {
|
|
319
|
+
auditTrailService.logPhotosValidated(sessionId);
|
|
316
320
|
setFileUploaded({
|
|
317
321
|
front: capturedImages.recto,
|
|
318
322
|
back: capturedImages.verso || null,
|
|
@@ -334,6 +338,8 @@ var DocumentCheck = function (_a) {
|
|
|
334
338
|
handleProcessingComplete(success, undefined, analysisData);
|
|
335
339
|
};
|
|
336
340
|
var handleDocumentTypeSelect = function (documentId) {
|
|
341
|
+
var documentLabel = t("documentTypes.".concat(documentId), documentId);
|
|
342
|
+
auditTrailService.logDocumentTypeSelected(sessionId, documentId, documentLabel);
|
|
337
343
|
var documentTemplateID = loadingTemplates
|
|
338
344
|
? undefined
|
|
339
345
|
: documentTemplate.getDocumentTemplateId({
|
|
@@ -361,6 +367,11 @@ var DocumentCheck = function (_a) {
|
|
|
361
367
|
setDocStep(3);
|
|
362
368
|
};
|
|
363
369
|
var handleDocumentUpload = function (files) {
|
|
370
|
+
auditTrailService.logDocumentLoaded(sessionId, "recto");
|
|
371
|
+
if (files.back) {
|
|
372
|
+
auditTrailService.logDocumentLoaded(sessionId, "verso");
|
|
373
|
+
}
|
|
374
|
+
auditTrailService.logDocumentsValidated(sessionId);
|
|
364
375
|
setFileUploaded(files);
|
|
365
376
|
// Check if retry limit is reached before processing
|
|
366
377
|
if (!isRetryAllowed() && retryCount > 0) {
|
|
@@ -495,40 +506,17 @@ var DocumentCheck = function (_a) {
|
|
|
495
506
|
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_check.selection_error.title", "Erreur de sélection") }), jsxRuntime.jsx("p", { className: "text-gray-600 mb-4", children: t("document_check.selection_error.description", "Aucun type de document sélectionné. Veuillez revenir à l'étape précédente.") }), jsxRuntime.jsx(ButtonDesktop.default, { className: "px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors", type: "back", onClick: function () { return setDocStep(2); }, children: t("document_check.selection_error.back", "Retour à la sélection") })] }));
|
|
496
507
|
}
|
|
497
508
|
if (isPictureAllowed && isDownloadAllowed && !selectedMethod) {
|
|
498
|
-
return (jsxRuntime.jsx(MobilePageLayout.default, { footer: jsxRuntime.jsx("div", { className: "w-full max-w-md mx-auto", children: jsxRuntime.jsx(ButtonDesktop.default, { type: "back", onClick: handleBack, className: "w-full text-[#3C3C40] text-center font-poppins text-sm font-medium hover:underline py-2", children: t("buttons.back", "Retour") }) }), children: jsxRuntime.jsx("div", { className: "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.jsxs("div", { className: "text-center space-y-4", children: [jsxRuntime.jsx(Title.default, { className: "text-xl md:text-2xl lg:text-3xl", children: t("document_check.method_selection.title", "Choisissez une méthode") }), jsxRuntime.jsx(Subtitle.default, { className: "text-sm text-gray-600 leading-relaxed", children: t("document_check.method_selection.subtitle", "Comment souhaitez-vous ajouter votre document ?") })] }), jsxRuntime.jsxs("div", { className: "grid gap-4", children: [jsxRuntime.jsxs("button", { onClick: function () {
|
|
509
|
+
return (jsxRuntime.jsx(MobilePageLayout.default, { footer: jsxRuntime.jsx("div", { className: "w-full max-w-md mx-auto", children: jsxRuntime.jsx(ButtonDesktop.default, { type: "back", onClick: handleBack, className: "w-full text-[#3C3C40] text-center font-poppins text-sm font-medium hover:underline py-2", children: t("buttons.back", "Retour") }) }), children: jsxRuntime.jsx("div", { className: "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.jsxs("div", { className: "text-center space-y-4", children: [jsxRuntime.jsx(Title.default, { className: "text-xl md:text-2xl lg:text-3xl", children: t("document_check.method_selection.title", "Choisissez une méthode") }), jsxRuntime.jsx(Subtitle.default, { className: "text-sm text-gray-600 leading-relaxed", children: t("document_check.method_selection.subtitle", "Comment souhaitez-vous ajouter votre document ?") })] }), jsxRuntime.jsxs("div", { className: "grid gap-4", children: [jsxRuntime.jsxs("button", { onClick: function () { setSelectedMethod("picture"); auditTrailService.logCaptureModeSelected(sessionId, "picture"); }, className: "flex items-center p-4 bg-white border-2 border-gray-100 rounded-xl hover:border-teal-500 transition-colors text-left group", children: [jsxRuntime.jsx("div", { className: "w-12 h-12 bg-teal-50 rounded-lg flex items-center justify-center text-teal-600 group-hover:bg-teal-100 transition-colors mr-4", children: jsxRuntime.jsx(lucideReact.Camera, { size: 24 }) }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("p", { className: "font-semibold text-gray-900", children: t("document_check.method_selection.picture_title", "Prendre une photo") }), jsxRuntime.jsx("p", { className: "text-sm text-gray-500", children: t("document_check.method_selection.picture_desc", "Utilisez l'appareil photo de votre appareil") })] })] }), jsxRuntime.jsxs("button", { onClick: function () { setSelectedMethod("download"); auditTrailService.logCaptureModeSelected(sessionId, "upload"); }, className: "flex items-center p-4 bg-white border-2 border-gray-100 rounded-xl hover:border-teal-500 transition-colors text-left group", children: [jsxRuntime.jsx("div", { className: "w-12 h-12 bg-teal-50 rounded-lg flex items-center justify-center text-teal-600 group-hover:bg-teal-100 transition-colors mr-4", children: jsxRuntime.jsx(lucideReact.Upload, { size: 24 }) }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("p", { className: "font-semibold text-gray-900", children: t("document_check.method_selection.download_title", "Téléverser un fichier") }), jsxRuntime.jsx("p", { className: "text-sm text-gray-500", children: t("document_check.method_selection.download_desc", "Sélectionnez un fichier sur votre appareil") })] })] })] })] }) }) }));
|
|
499
510
|
}
|
|
500
511
|
var activeMethod = selectedMethod ||
|
|
501
512
|
(isPictureAllowed && isMobileCapture ? "picture" : "download");
|
|
502
513
|
if (activeMethod === "picture" && isPictureAllowed) {
|
|
503
|
-
var
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
case "recto":
|
|
510
|
-
return (jsxRuntime.jsx(Photo.default, { onCapture: function (imageData) {
|
|
511
|
-
return handlePhotoCapture(imageData, "recto");
|
|
512
|
-
} }));
|
|
513
|
-
case "before-verso":
|
|
514
|
-
return (jsxRuntime.jsx(BeforeVersoPhoto.default, { setStep: function () { return setCurrentPhotoStep("verso"); } }));
|
|
515
|
-
case "verso":
|
|
516
|
-
return (jsxRuntime.jsx(Photo.default, { onCapture: function (imageData) {
|
|
517
|
-
return handlePhotoCapture(imageData, "verso");
|
|
518
|
-
} }));
|
|
519
|
-
case "confirmation":
|
|
520
|
-
return (jsxRuntime.jsx(PhotoConfirmation.default, { imageUrl: capturedImages.recto || "", versoImageUrl: capturedImages.verso, requiresTwoSides: !!capturedImages.verso, onConfirm: onConfirm, onRetry: function () { return setCurrentPhotoStep("before-recto"); }, onRetryAfterProcessing: function () {
|
|
521
|
-
return setCurrentPhotoStep("before-recto");
|
|
522
|
-
}, fileUploaded: fileUploaded, isSingleSided: isSingleSided }));
|
|
523
|
-
default:
|
|
524
|
-
setCurrentPhotoStep("before-recto");
|
|
525
|
-
return (jsxRuntime.jsx(BeforePhoto.default, { setStep: function () { return setCurrentPhotoStep("recto"); }, isSingleSided: isSingleSided, onBack: function () { return setDocStep(2); } }));
|
|
526
|
-
}
|
|
527
|
-
};
|
|
528
|
-
if (node.withVideo) {
|
|
529
|
-
if (videoFlowPhase === "photo") {
|
|
530
|
-
return renderPhotoCaptureFlow(handlePhotoConfirmedForVideo);
|
|
531
|
-
}
|
|
514
|
+
var isSingleSided = (selectedDocumentType === null || selectedDocumentType === void 0 ? void 0 : selectedDocumentType.id) === "passport" ||
|
|
515
|
+
(selectedDocumentType === null || selectedDocumentType === void 0 ? void 0 : selectedDocumentType.id) === "pinkDriverLicense";
|
|
516
|
+
var onConfirm = node.withVideo
|
|
517
|
+
? handlePhotoConfirmedForVideo
|
|
518
|
+
: handlePhotoConfirmation;
|
|
519
|
+
if (node.withVideo && videoFlowPhase === "video") {
|
|
532
520
|
return (jsxRuntime.jsx(DocumentVideoCapture.default, { selectedDocumentType: selectedDocumentType, onComplete: handleDocumentVideoComplete, onBack: function () {
|
|
533
521
|
setVideoFlowPhase("photo");
|
|
534
522
|
setCurrentPhotoStep("confirmation");
|
|
@@ -537,7 +525,22 @@ var DocumentCheck = function (_a) {
|
|
|
537
525
|
verso: capturedImages.verso,
|
|
538
526
|
} }));
|
|
539
527
|
}
|
|
540
|
-
|
|
528
|
+
if (currentPhotoStep === "before-recto") {
|
|
529
|
+
return (jsxRuntime.jsx(BeforePhoto.default, { setStep: function () { return setCurrentPhotoStep("recto"); }, isSingleSided: isSingleSided, onBack: function () { return setDocStep(2); } }));
|
|
530
|
+
}
|
|
531
|
+
if (currentPhotoStep === "recto") {
|
|
532
|
+
return (jsxRuntime.jsx(Photo.default, { onCapture: function (imageData) { return handlePhotoCapture(imageData, "recto"); } }));
|
|
533
|
+
}
|
|
534
|
+
if (currentPhotoStep === "before-verso") {
|
|
535
|
+
return (jsxRuntime.jsx(BeforeVersoPhoto.default, { setStep: function () { return setCurrentPhotoStep("verso"); } }));
|
|
536
|
+
}
|
|
537
|
+
if (currentPhotoStep === "verso") {
|
|
538
|
+
return (jsxRuntime.jsx(Photo.default, { onCapture: function (imageData) { return handlePhotoCapture(imageData, "verso"); } }));
|
|
539
|
+
}
|
|
540
|
+
if (currentPhotoStep === "confirmation") {
|
|
541
|
+
return (jsxRuntime.jsx(PhotoConfirmation.default, { imageUrl: capturedImages.recto || "", versoImageUrl: capturedImages.verso, requiresTwoSides: !!capturedImages.verso, onConfirm: onConfirm, onRetry: function () { return setCurrentPhotoStep("before-recto"); }, onRetryAfterProcessing: function () { return setCurrentPhotoStep("before-recto"); }, fileUploaded: fileUploaded, isSingleSided: isSingleSided }));
|
|
542
|
+
}
|
|
543
|
+
return (jsxRuntime.jsx(BeforePhoto.default, { setStep: function () { return setCurrentPhotoStep("recto"); }, isSingleSided: isSingleSided, onBack: function () { return setDocStep(2); } }));
|
|
541
544
|
}
|
|
542
545
|
else {
|
|
543
546
|
return (jsxRuntime.jsx(JDIDocumentUpload.default, { documentType: (selectedDocumentType === null || selectedDocumentType === void 0 ? void 0 : selectedDocumentType.id) || documentTypeId, documentTypeId: documentTypeId, documentLabel: selectedDocumentType === null || selectedDocumentType === void 0 ? void 0 : selectedDocumentType.label, onUpload: handleDocumentUpload, onBack: function () {
|
|
@@ -547,7 +550,7 @@ var DocumentCheck = function (_a) {
|
|
|
547
550
|
else {
|
|
548
551
|
setDocStep(2);
|
|
549
552
|
}
|
|
550
|
-
}, initialFront: errorCode === "2.5" ? fileUploaded === null || fileUploaded === void 0 ? void 0 : fileUploaded.front : null, initialBack: errorCode === "2.5" ? fileUploaded === null || fileUploaded === void 0 ? void 0 : fileUploaded.back : null }));
|
|
553
|
+
}, initialFront: errorCode === "2.5" ? fileUploaded === null || fileUploaded === void 0 ? void 0 : fileUploaded.front : null, initialBack: errorCode === "2.5" ? fileUploaded === null || fileUploaded === void 0 ? void 0 : fileUploaded.back : null, sessionId: sessionId }));
|
|
551
554
|
}
|
|
552
555
|
case 4:
|
|
553
556
|
return (jsxRuntime.jsx(JDIProcessing.default, { documentType: (selectedDocumentType === null || selectedDocumentType === void 0 ? void 0 : selectedDocumentType.id) || documentTypeId, onProcessingComplete: handleProcessingComplete, fileUploaded: fileUploaded, documentTypeId: documentTypeId, retryCount: retryCount, documentTemplateId: selectedDocumentType === null || selectedDocumentType === void 0 ? void 0 : selectedDocumentType.documentTemplateId, nodeId: node.id }));
|