datakeen-session-react 1.1.140-dev.127 → 1.1.140-dev.128
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 +1 -1
- package/dist/cjs/components/document-collection/DocumentCollection.js.map +1 -1
- package/dist/cjs/components/document-collection/DocumentCollectionIntroduction.js +1 -1
- package/dist/cjs/components/document-collection/DocumentCollectionIntroduction.js.map +1 -1
- package/dist/cjs/components/document-collection/DocumentCollectionMethodSelection.js +1 -1
- package/dist/cjs/components/document-collection/DocumentCollectionMethodSelection.js.map +1 -1
- package/dist/cjs/components/document-collection/DocumentCollectionSelection.js +1 -1
- package/dist/cjs/components/document-collection/DocumentCollectionSelection.js.map +1 -1
- package/dist/cjs/components/document-collection/DocumentCollectionUpload.js +1 -1
- package/dist/cjs/components/document-collection/DocumentCollectionUpload.js.map +1 -1
- package/dist/cjs/components/jdi/JDICountrySelection.js +1 -1
- package/dist/cjs/components/jdi/JDICountrySelection.js.map +1 -1
- package/dist/cjs/components/jdi/JDIDocumentSelection.js +1 -1
- package/dist/cjs/components/jdi/JDIDocumentSelection.js.map +1 -1
- package/dist/cjs/components/jdi/JDIDocumentUpload.js +1 -1
- package/dist/cjs/components/jdi/JDIDocumentUpload.js.map +1 -1
- package/dist/cjs/components/jdi/JDIPreIntroduction.js +1 -1
- package/dist/cjs/components/jdi/JDIPreIntroduction.js.map +1 -1
- package/dist/cjs/components/selfie/Video.js +2 -2
- package/dist/cjs/components/selfie/Video.js.map +1 -1
- package/dist/cjs/components/selfie/selfie-flow/SelfieFlow.js +2 -11
- package/dist/cjs/components/selfie/selfie-flow/SelfieFlow.js.map +1 -1
- package/dist/cjs/components/selfie/selfie-flow/SelfiePreIntroduction.js.map +1 -1
- package/dist/cjs/components/session/DocumentCheck.js +1 -1
- package/dist/cjs/components/session/DocumentCheck.js.map +1 -1
- package/dist/cjs/components/session/Selfie.js +4 -18
- package/dist/cjs/components/session/Selfie.js.map +1 -1
- package/dist/cjs/components/session/UserInputForm.js +1 -7
- package/dist/cjs/components/session/UserInputForm.js.map +1 -1
- package/dist/cjs/components/signature-electronic/SignatureElectronic.js +1 -1
- package/dist/cjs/components/signature-electronic/SignatureElectronic.js.map +1 -1
- package/dist/cjs/components/signature-electronic/SignatureElectronicIntroduction.js +2 -2
- package/dist/cjs/components/signature-electronic/SignatureElectronicIntroduction.js.map +1 -1
- package/dist/cjs/hooks/useStepNavigation.js +60 -12
- package/dist/cjs/hooks/useStepNavigation.js.map +1 -1
- package/dist/cjs/hooks/useUserInputForm.js +1 -2
- package/dist/cjs/hooks/useUserInputForm.js.map +1 -1
- package/dist/cjs/types/session.js.map +1 -1
- package/dist/esm/components/document-collection/DocumentCollection.js +1 -1
- package/dist/esm/components/document-collection/DocumentCollection.js.map +1 -1
- package/dist/esm/components/document-collection/DocumentCollectionIntroduction.js +1 -1
- package/dist/esm/components/document-collection/DocumentCollectionIntroduction.js.map +1 -1
- package/dist/esm/components/document-collection/DocumentCollectionMethodSelection.js +1 -1
- package/dist/esm/components/document-collection/DocumentCollectionMethodSelection.js.map +1 -1
- package/dist/esm/components/document-collection/DocumentCollectionSelection.js +1 -1
- package/dist/esm/components/document-collection/DocumentCollectionSelection.js.map +1 -1
- package/dist/esm/components/document-collection/DocumentCollectionUpload.js +1 -1
- package/dist/esm/components/document-collection/DocumentCollectionUpload.js.map +1 -1
- package/dist/esm/components/jdi/JDICountrySelection.js +1 -1
- package/dist/esm/components/jdi/JDICountrySelection.js.map +1 -1
- package/dist/esm/components/jdi/JDIDocumentSelection.js +1 -1
- package/dist/esm/components/jdi/JDIDocumentSelection.js.map +1 -1
- package/dist/esm/components/jdi/JDIDocumentUpload.js +1 -1
- package/dist/esm/components/jdi/JDIDocumentUpload.js.map +1 -1
- package/dist/esm/components/jdi/JDIPreIntroduction.js +1 -1
- package/dist/esm/components/jdi/JDIPreIntroduction.js.map +1 -1
- package/dist/esm/components/selfie/Video.js +2 -2
- package/dist/esm/components/selfie/Video.js.map +1 -1
- package/dist/esm/components/selfie/selfie-flow/SelfieFlow.js +2 -11
- package/dist/esm/components/selfie/selfie-flow/SelfieFlow.js.map +1 -1
- package/dist/esm/components/selfie/selfie-flow/SelfiePreIntroduction.js.map +1 -1
- package/dist/esm/components/session/DocumentCheck.js +1 -1
- package/dist/esm/components/session/DocumentCheck.js.map +1 -1
- package/dist/esm/components/session/Selfie.js +4 -18
- package/dist/esm/components/session/Selfie.js.map +1 -1
- package/dist/esm/components/session/UserInputForm.js +1 -7
- package/dist/esm/components/session/UserInputForm.js.map +1 -1
- package/dist/esm/components/signature-electronic/SignatureElectronic.js +1 -1
- package/dist/esm/components/signature-electronic/SignatureElectronic.js.map +1 -1
- package/dist/esm/components/signature-electronic/SignatureElectronicIntroduction.js +2 -2
- package/dist/esm/components/signature-electronic/SignatureElectronicIntroduction.js.map +1 -1
- package/dist/esm/hooks/useStepNavigation.js +60 -12
- package/dist/esm/hooks/useStepNavigation.js.map +1 -1
- package/dist/esm/hooks/useUserInputForm.js +1 -2
- package/dist/esm/hooks/useUserInputForm.js.map +1 -1
- package/dist/esm/types/session.js.map +1 -1
- package/docs/navigation-history.md +18 -1
- package/package.json +1 -1
|
@@ -279,7 +279,7 @@ var DocumentCollection = function (_a) {
|
|
|
279
279
|
};
|
|
280
280
|
switch (currentStep) {
|
|
281
281
|
case 0:
|
|
282
|
-
return (jsxRuntime.jsx(DocumentCollectionIntroduction.default, { onContinue: handleContinueFromIntroduction, onBack: handleBack, introductionPage: introductionPage }));
|
|
282
|
+
return (jsxRuntime.jsx(DocumentCollectionIntroduction.default, { onContinue: handleContinueFromIntroduction, onBack: stepObject.canGoBack ? handleBack : undefined, introductionPage: introductionPage }));
|
|
283
283
|
case 1:
|
|
284
284
|
return (jsxRuntime.jsx(DocumentCollectionSelection.default, { onContinue: handleDocumentTypeSelect, onBack: handleBack, allowedDocumentTypes: allowedDocumentTypes, allowedAddingMethods: allowedAddingMethods, stepObject: stepObject, documentSelection: documentSelection }));
|
|
285
285
|
case 2:
|
|
@@ -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 /** 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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B,EAE1B,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,YAAY,IAAI,SAAS,EACtC,SAAS,EAAE,SAAS,IAAI,SAAS,EACjC,iBAAiB,EAAE,iBAAiB,EACpC,uBAAuB,EAAE,uBAAuB,EAChD,cAAc,EAAE,cAAc,EAAE,EAChC,aAAa,EAAE,aAAa,EAAA,CAC5B;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={stepObject.canGoBack ? handleBack : undefined}\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,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A;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;;;;"}
|
|
@@ -23,7 +23,7 @@ var DocumentCollectionIntroduction = function (_a) {
|
|
|
23
23
|
t("document_upload.selection_title");
|
|
24
24
|
var description = (introductionPage === null || introductionPage === void 0 ? void 0 : introductionPage.description) ||
|
|
25
25
|
t("document_upload.selection_description");
|
|
26
|
-
return (jsxRuntime.jsx(MobilePageLayout.default, { footer: jsxRuntime.jsx(PageActions.default, { primary: jsxRuntime.jsx(Button.default, { onClick: onContinue, children: t("buttons.continue") }), secondary: jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: onBack, children: t("buttons.back") }) }), children: jsxRuntime.jsx("div", { className: "px-4 py-6 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: title }), jsxRuntime.jsx(Subtitle.default, { className: "text-sm md:text-base text-gray-600 leading-relaxed whitespace-pre-line", children: description })] }), jsxRuntime.jsx("div", { className: "flex justify-center py-6", children: jsxRuntime.jsx("img", { src: beforeDocument.default, alt: t("document_upload.selection_title"), className: "max-w-full h-auto object-contain max-h-[25vh]" }) }), jsxRuntime.jsx("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-4", children: jsxRuntime.jsxs("div", { className: "flex", children: [jsxRuntime.jsx("div", { className: "flex-shrink-0", children: jsxRuntime.jsx("svg", { className: "h-5 w-5 text-blue-400", fill: "currentColor", viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", clipRule: "evenodd" }) }) }), jsxRuntime.jsxs("div", { className: "ml-3", children: [jsxRuntime.jsx("h3", { className: "text-sm font-medium text-blue-800", children: t("jdi.document_selection.info_title") }), jsxRuntime.jsx("div", { className: "mt-2 text-sm text-blue-700", children: jsxRuntime.jsxs("ul", { className: "list-disc pl-5 space-y-1", children: [jsxRuntime.jsx("li", { children: t("jdi.document_upload.info_point1") }), jsxRuntime.jsx("li", { children: t("jdi.document_upload.accepted_formats") }), jsxRuntime.jsxs("li", { children: [t("jdi.document_upload.max_size_label"), " ", t("jdi.document_upload.max_size")] })] }) })] })] }) })] }) }) }));
|
|
26
|
+
return (jsxRuntime.jsx(MobilePageLayout.default, { footer: jsxRuntime.jsx(PageActions.default, { primary: jsxRuntime.jsx(Button.default, { onClick: onContinue, children: t("buttons.continue") }), secondary: onBack ? (jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: onBack, children: t("buttons.back") })) : undefined }), children: jsxRuntime.jsx("div", { className: "px-4 py-6 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: title }), jsxRuntime.jsx(Subtitle.default, { className: "text-sm md:text-base text-gray-600 leading-relaxed whitespace-pre-line", children: description })] }), jsxRuntime.jsx("div", { className: "flex justify-center py-6", children: jsxRuntime.jsx("img", { src: beforeDocument.default, alt: t("document_upload.selection_title"), className: "max-w-full h-auto object-contain max-h-[25vh]" }) }), jsxRuntime.jsx("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-4", children: jsxRuntime.jsxs("div", { className: "flex", children: [jsxRuntime.jsx("div", { className: "flex-shrink-0", children: jsxRuntime.jsx("svg", { className: "h-5 w-5 text-blue-400", fill: "currentColor", viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", clipRule: "evenodd" }) }) }), jsxRuntime.jsxs("div", { className: "ml-3", children: [jsxRuntime.jsx("h3", { className: "text-sm font-medium text-blue-800", children: t("jdi.document_selection.info_title") }), jsxRuntime.jsx("div", { className: "mt-2 text-sm text-blue-700", children: jsxRuntime.jsxs("ul", { className: "list-disc pl-5 space-y-1", children: [jsxRuntime.jsx("li", { children: t("jdi.document_upload.info_point1") }), jsxRuntime.jsx("li", { children: t("jdi.document_upload.accepted_formats") }), jsxRuntime.jsxs("li", { children: [t("jdi.document_upload.max_size_label"), " ", t("jdi.document_upload.max_size")] })] }) })] })] }) })] }) }) }));
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
exports.default = DocumentCollectionIntroduction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentCollectionIntroduction.js","sources":["../../../../../src/components/document-collection/DocumentCollectionIntroduction.tsx"],"sourcesContent":["import Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport Button from \"../ui/Button\";\nimport PageActions from \"../ui/PageActions\";\nimport { beforeDocumentIcon } from \"../../assets\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\n\ninterface DocumentCollectionIntroductionProps {\n onContinue: () => void;\n onBack
|
|
1
|
+
{"version":3,"file":"DocumentCollectionIntroduction.js","sources":["../../../../../src/components/document-collection/DocumentCollectionIntroduction.tsx"],"sourcesContent":["import Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport Button from \"../ui/Button\";\nimport PageActions from \"../ui/PageActions\";\nimport { beforeDocumentIcon } from \"../../assets\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\n\ninterface DocumentCollectionIntroductionProps {\n onContinue: () => void;\n onBack?: () => void;\n introductionPage?: {\n title?: string;\n description?: string;\n };\n}\n\nconst DocumentCollectionIntroduction = ({\n onContinue,\n onBack,\n introductionPage,\n}: DocumentCollectionIntroductionProps) => {\n // Use provided values or fallback to defaults (use i18n keys)\n const { t } = useI18n();\n const title =\n introductionPage?.title ||\n t(\"document_upload.selection_title\");\n const description =\n introductionPage?.description ||\n t(\"document_upload.selection_description\");\n\n return (\n <MobilePageLayout\n footer={\n <PageActions\n primary={\n <Button onClick={onContinue}>\n {t(\"buttons.continue\")}\n </Button>\n }\n secondary={onBack ? (\n <Button variant=\"secondary\" onClick={onBack}>\n {t(\"buttons.back\")}\n </Button>\n ) : undefined}\n />\n }\n >\n <div className=\"px-4 py-6 md:px-8 md:py-8\">\n <div className=\"w-full max-w-md mx-auto space-y-6\">\n {/* Header */}\n <div className=\"text-center space-y-4\">\n <Title className=\"text-xl md:text-2xl lg:text-3xl\">{title}</Title>\n <Subtitle className=\"text-sm md:text-base text-gray-600 leading-relaxed whitespace-pre-line\">\n {description}\n </Subtitle>\n </div>\n\n {/* Document collection illustration */}\n <div className=\"flex justify-center py-6\">\n <img\n src={beforeDocumentIcon}\n alt={t(\"document_upload.selection_title\")}\n className=\"max-w-full h-auto object-contain max-h-[25vh]\"\n />\n </div>\n\n {/* Information box */}\n <div className=\"bg-blue-50 border border-blue-200 rounded-lg p-4\">\n <div className=\"flex\">\n <div className=\"flex-shrink-0\">\n <svg\n className=\"h-5 w-5 text-blue-400\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z\"\n clipRule=\"evenodd\"\n />\n </svg>\n </div>\n <div className=\"ml-3\">\n <h3 className=\"text-sm font-medium text-blue-800\">\n {t(\"jdi.document_selection.info_title\")}\n </h3>\n <div className=\"mt-2 text-sm text-blue-700\">\n <ul className=\"list-disc pl-5 space-y-1\">\n <li>{t(\"jdi.document_upload.info_point1\")}</li>\n <li>{t(\"jdi.document_upload.accepted_formats\")}</li>\n <li>{t(\"jdi.document_upload.max_size_label\")} {t(\"jdi.document_upload.max_size\")}</li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </MobilePageLayout>\n );\n};\n\nexport default DocumentCollectionIntroduction;\n"],"names":["useI18n","_jsx","MobilePageLayout","PageActions","Button","_jsxs","Title","Subtitle","beforeDocumentIcon"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,IAAM,8BAA8B,GAAG,UAAC,EAIF,EAAA;AAHpC,IAAA,IAAA,UAAU,gBAAA,EACV,MAAM,GAAA,EAAA,CAAA,MAAA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,7 @@ var MobilePageLayout = require('../ui/MobilePageLayout.js');
|
|
|
14
14
|
var DocumentCollectionMethodSelection = function (_a) {
|
|
15
15
|
var onMethodSelect = _a.onMethodSelect, onBack = _a.onBack, title = _a.title, description = _a.description;
|
|
16
16
|
var t = useI18n.useI18n().t;
|
|
17
|
-
return (jsxRuntime.jsx(MobilePageLayout.default, { footer: jsxRuntime.jsx(PageActions.default, { primary: jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: onBack, 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: title || t("document_check.method_selection.title", "Choisissez une méthode") }), jsxRuntime.jsx(Subtitle.default, { className: "text-sm text-gray-600 leading-relaxed", children: description || 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 () { return onMethodSelect("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 () { return onMethodSelect("download"); }, 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") })] })] })] })] }) }) }));
|
|
17
|
+
return (jsxRuntime.jsx(MobilePageLayout.default, { footer: jsxRuntime.jsx(PageActions.default, { primary: onBack ? (jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: onBack, children: t("buttons.back", "Retour") })) : undefined }), 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: title || t("document_check.method_selection.title", "Choisissez une méthode") }), jsxRuntime.jsx(Subtitle.default, { className: "text-sm text-gray-600 leading-relaxed", children: description || 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 () { return onMethodSelect("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 () { return onMethodSelect("download"); }, 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") })] })] })] })] }) }) }));
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
exports.default = DocumentCollectionMethodSelection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentCollectionMethodSelection.js","sources":["../../../../../src/components/document-collection/DocumentCollectionMethodSelection.tsx"],"sourcesContent":["import React from \"react\";\nimport { Camera, Upload } from \"lucide-react\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport Button from \"../ui/Button\";\nimport PageActions from \"../ui/PageActions\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\n\ninterface DocumentCollectionMethodSelectionProps {\n onMethodSelect: (method: \"download\" | \"picture\") => void;\n onBack
|
|
1
|
+
{"version":3,"file":"DocumentCollectionMethodSelection.js","sources":["../../../../../src/components/document-collection/DocumentCollectionMethodSelection.tsx"],"sourcesContent":["import React from \"react\";\nimport { Camera, Upload } from \"lucide-react\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport Button from \"../ui/Button\";\nimport PageActions from \"../ui/PageActions\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\n\ninterface DocumentCollectionMethodSelectionProps {\n onMethodSelect: (method: \"download\" | \"picture\") => void;\n onBack?: () => void;\n title?: string;\n description?: string;\n}\n\nconst DocumentCollectionMethodSelection = ({\n onMethodSelect,\n onBack,\n title,\n description,\n}: DocumentCollectionMethodSelectionProps) => {\n const { t } = useI18n();\n\n return (\n <MobilePageLayout\n footer={\n <PageActions\n primary={onBack ? (\n <Button variant=\"secondary\" onClick={onBack}>\n {t(\"buttons.back\", \"Retour\")}\n </Button>\n ) : undefined}\n />\n }\n >\n <div className=\"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 <div className=\"text-center space-y-4\">\n <Title className=\"text-xl md:text-2xl lg:text-3xl\">\n {title || t(\"document_check.method_selection.title\", \"Choisissez une méthode\")}\n </Title>\n <Subtitle className=\"text-sm text-gray-600 leading-relaxed\">\n {description || t(\"document_check.method_selection.subtitle\", \"Comment souhaitez-vous ajouter votre document ?\")}\n </Subtitle>\n </div>\n\n <div className=\"grid gap-4\">\n <button\n onClick={() => onMethodSelect(\"picture\")}\n className=\"flex items-center p-4 bg-white border-2 border-gray-100 rounded-xl hover:border-teal-500 transition-colors text-left group\"\n >\n <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\">\n <Camera size={24} />\n </div>\n <div>\n <p className=\"font-semibold text-gray-900\">\n {t(\"document_check.method_selection.picture_title\", \"Prendre une photo\")}\n </p>\n <p className=\"text-sm text-gray-500\">\n {t(\"document_check.method_selection.picture_desc\", \"Utilisez l'appareil photo de votre appareil\")}\n </p>\n </div>\n </button>\n\n <button\n onClick={() => onMethodSelect(\"download\")}\n className=\"flex items-center p-4 bg-white border-2 border-gray-100 rounded-xl hover:border-teal-500 transition-colors text-left group\"\n >\n <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\">\n <Upload size={24} />\n </div>\n <div>\n <p className=\"font-semibold text-gray-900\">\n {t(\"document_check.method_selection.download_title\", \"Téléverser un fichier\")}\n </p>\n <p className=\"text-sm text-gray-500\">\n {t(\"document_check.method_selection.download_desc\", \"Sélectionnez un fichier sur votre appareil\")}\n </p>\n </div>\n </button>\n </div>\n </div>\n </div>\n </MobilePageLayout>\n );\n};\n\nexport default DocumentCollectionMethodSelection;\n"],"names":["useI18n","_jsx","MobilePageLayout","PageActions","Button","_jsxs","Title","Subtitle","Camera","Upload"],"mappings":";;;;;;;;;;;;;AAgBA,IAAM,iCAAiC,GAAG,UAAC,EAKF,EAAA;QAJrC,cAAc,GAAA,EAAA,CAAA,cAAA,EACd,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,WAAW,GAAA,EAAA,CAAA,WAAA;AAEH,IAAA,IAAA,CAAC,GAAKA,eAAO,EAAE,EAAd;IAET,QACIC,eAACC,wBAAgB,EAAA,EACb,MAAM,EACFD,cAAA,CAACE,mBAAW,EAAA,EACR,OAAO,EAAE,MAAM,IACXF,cAAA,CAACG,cAAM,IAAC,OAAO,EAAC,WAAW,EAAC,OAAO,EAAE,MAAM,EAAA,QAAA,EACtC,CAAC,CAAC,cAAc,EAAE,QAAQ,CAAC,EAAA,CACvB,IACT,SAAS,GACf,EAAA,QAAA,EAGNH,cAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,iCAAiC,EAAA,QAAA,EAC5CI,yBAAK,SAAS,EAAC,mCAAmC,EAAA,QAAA,EAAA,CAC9CA,eAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,uBAAuB,EAAA,QAAA,EAAA,CAClCJ,cAAA,CAACK,aAAK,EAAA,EAAC,SAAS,EAAC,iCAAiC,EAAA,QAAA,EAC7C,KAAK,IAAI,CAAC,CAAC,uCAAuC,EAAE,wBAAwB,CAAC,EAAA,CAC1E,EACRL,cAAA,CAACM,gBAAQ,EAA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S,EAAC,uBAAuB,EAAA,QAAA,EAC/B,CAAC,CAAC,+CAA+C,EAAE,4CAA4C,CAAC,EAAA,CACjG,CAAA,EAAA,CACF,CAAA,EAAA,CACD,IACP,CAAA,EAAA,CACJ,EAAA,CACJ,EAAA,CACS;AAE3B;;;;"}
|
|
@@ -34,7 +34,7 @@ var DocumentCollectionSelection = function (_a) {
|
|
|
34
34
|
onContinue(selectedDocumentType);
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
return (jsxRuntime.jsx(MobilePageLayout.default, { footer: jsxRuntime.jsx(PageActions.default, { primary: jsxRuntime.jsx(Button.default, { onClick: handleContinueAction, disabled: !selectedDocumentType, children: t("buttons.continue") }), secondary: jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: onBack, children: t("buttons.back") }) }), children: jsxRuntime.jsx("div", { className: "flex-1 flex items-start justify-center md:items-center p-4", children: jsxRuntime.jsxs("div", { className: "w-full max-w-lg", children: [jsxRuntime.jsxs("div", { className: "text-center mb-8", children: [jsxRuntime.jsx(Title.default, { className: "text-2xl md:text-3xl font-bold text-gray-900 mb-2", children: title }), jsxRuntime.jsx(Subtitle.default, { className: "text-gray-600 whitespace-pre-line", children: description })] }), jsxRuntime.jsxs("div", { className: "mb-6", children: [jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t("jdi.document_selection.label_identity") }), jsxRuntime.jsx(SelectComponent.Select, { options: documentOptions, value: selectedDocumentType, onValueChange: function (value) { return setSelectedDocumentType(value); }, placeholder: t("jdi.document_selection.placeholder_identity") })] }), selectedDocumentType && (jsxRuntime.jsxs("div", { className: "bg-gray-50 border border-gray-200 rounded-lg p-4 mb-6", children: [jsxRuntime.jsx("h3", { className: "font-medium text-gray-900 mb-2", children: t("jdi.document_selection.info_title") }), jsxRuntime.jsxs("div", { className: "text-sm text-gray-700 space-y-1", children: [jsxRuntime.jsx("p", { children: t("jdi.document_upload.info_point1") }), jsxRuntime.jsx("p", { children: t("jdi.document_upload.info_point2") }), jsxRuntime.jsx("p", { children: t("jdi.document_upload.info_point3") })] })] }))] }) }) }));
|
|
37
|
+
return (jsxRuntime.jsx(MobilePageLayout.default, { footer: jsxRuntime.jsx(PageActions.default, { primary: jsxRuntime.jsx(Button.default, { onClick: handleContinueAction, disabled: !selectedDocumentType, children: t("buttons.continue") }), secondary: onBack ? (jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: onBack, children: t("buttons.back") })) : undefined }), children: jsxRuntime.jsx("div", { className: "flex-1 flex items-start justify-center md:items-center p-4", children: jsxRuntime.jsxs("div", { className: "w-full max-w-lg", children: [jsxRuntime.jsxs("div", { className: "text-center mb-8", children: [jsxRuntime.jsx(Title.default, { className: "text-2xl md:text-3xl font-bold text-gray-900 mb-2", children: title }), jsxRuntime.jsx(Subtitle.default, { className: "text-gray-600 whitespace-pre-line", children: description })] }), jsxRuntime.jsxs("div", { className: "mb-6", children: [jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t("jdi.document_selection.label_identity") }), jsxRuntime.jsx(SelectComponent.Select, { options: documentOptions, value: selectedDocumentType, onValueChange: function (value) { return setSelectedDocumentType(value); }, placeholder: t("jdi.document_selection.placeholder_identity") })] }), selectedDocumentType && (jsxRuntime.jsxs("div", { className: "bg-gray-50 border border-gray-200 rounded-lg p-4 mb-6", children: [jsxRuntime.jsx("h3", { className: "font-medium text-gray-900 mb-2", children: t("jdi.document_selection.info_title") }), jsxRuntime.jsxs("div", { className: "text-sm text-gray-700 space-y-1", children: [jsxRuntime.jsx("p", { children: t("jdi.document_upload.info_point1") }), jsxRuntime.jsx("p", { children: t("jdi.document_upload.info_point2") }), jsxRuntime.jsx("p", { children: t("jdi.document_upload.info_point3") })] })] }))] }) }) }));
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
exports.default = DocumentCollectionSelection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentCollectionSelection.js","sources":["../../../../../src/components/document-collection/DocumentCollectionSelection.tsx"],"sourcesContent":["import React, { useState, useEffect, useRef } from \"react\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport Button from \"../ui/Button\";\nimport PageActions from \"../ui/PageActions\";\nimport { Select } from \"../ui/SelectComponent\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport { DocumentTypeSide } from \"./DocumentCollection\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\nimport { stepObject } from \"../../types/session\";\nimport { Card } from \"../ui/Card\";\nimport { Upload } from \"lucide-react\";\nimport PDFPreview from \"../ui/PDFPreview\";\nimport type { onUploadFiles } from \"../../types/uploadFiles\";\n\ninterface AllowedDocumentType {\n id: string;\n name: string;\n side?: DocumentTypeSide;\n}\n\ninterface DocumentCollectionSelectionProps {\n onContinue: (selectedDocumentType: string, files?: onUploadFiles) => void;\n onBack
|
|
1
|
+
{"version":3,"file":"DocumentCollectionSelection.js","sources":["../../../../../src/components/document-collection/DocumentCollectionSelection.tsx"],"sourcesContent":["import React, { useState, useEffect, useRef } from \"react\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport Button from \"../ui/Button\";\nimport PageActions from \"../ui/PageActions\";\nimport { Select } from \"../ui/SelectComponent\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport { DocumentTypeSide } from \"./DocumentCollection\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\nimport { stepObject } from \"../../types/session\";\nimport { Card } from \"../ui/Card\";\nimport { Upload } from \"lucide-react\";\nimport PDFPreview from \"../ui/PDFPreview\";\nimport type { onUploadFiles } from \"../../types/uploadFiles\";\n\ninterface AllowedDocumentType {\n id: string;\n name: string;\n side?: DocumentTypeSide;\n}\n\ninterface DocumentCollectionSelectionProps {\n onContinue: (selectedDocumentType: string, files?: onUploadFiles) => void;\n onBack?: () => void;\n allowedDocumentTypes: AllowedDocumentType[];\n allowedAddingMethods: string[];\n stepObject?: stepObject;\n documentSelection?: {\n title?: string;\n description?: string;\n };\n}\n\nconst DocumentCollectionSelection = ({\n onContinue,\n onBack,\n allowedDocumentTypes,\n allowedAddingMethods,\n stepObject,\n documentSelection,\n}: DocumentCollectionSelectionProps) => {\n const { t } = useI18n();\n const [selectedDocumentType, setSelectedDocumentType] = useState<string>(\"\");\n\n useEffect(() => {\n if (allowedDocumentTypes.length > 0 && !selectedDocumentType) {\n setSelectedDocumentType(allowedDocumentTypes[0].id);\n }\n }, [allowedDocumentTypes, selectedDocumentType]);\n\n const title =\n documentSelection?.title ||\n t(\"document_upload.selection_title\");\n const description =\n documentSelection?.description ||\n t(\"document_upload.selection_description\");\n\n const documentOptions = allowedDocumentTypes.map((docType) => ({\n value: docType.id,\n label: t(docType.name) || docType.name,\n }));\n\n const handleContinueAction = () => {\n if (selectedDocumentType) {\n onContinue(selectedDocumentType);\n }\n };\n\n return (\n <MobilePageLayout\n footer={\n <PageActions\n primary={\n <Button onClick={handleContinueAction} disabled={!selectedDocumentType}>\n {t(\"buttons.continue\")}\n </Button>\n }\n secondary={onBack ? (\n <Button variant=\"secondary\" onClick={onBack}>\n {t(\"buttons.back\")}\n </Button>\n ) : undefined}\n />\n }\n >\n <div className=\"flex-1 flex items-start justify-center md:items-center p-4\">\n <div className=\"w-full max-w-lg\">\n <div className=\"text-center mb-8\">\n <Title className=\"text-2xl md:text-3xl font-bold text-gray-900 mb-2\">\n {title}\n </Title>\n <Subtitle className=\"text-gray-600 whitespace-pre-line\">{description}</Subtitle>\n </div>\n\n {/* Document Type Selection */}\n <div className=\"mb-6\">\n <label className=\"block text-sm font-medium text-gray-700 mb-2\">\n {t(\"jdi.document_selection.label_identity\")}\n </label>\n <Select\n options={documentOptions}\n value={selectedDocumentType}\n onValueChange={(value) => setSelectedDocumentType(value)}\n placeholder={t(\"jdi.document_selection.placeholder_identity\")}\n />\n </div>\n\n {/* Information about selected document */}\n {selectedDocumentType && (\n <div className=\"bg-gray-50 border border-gray-200 rounded-lg p-4 mb-6\">\n <h3 className=\"font-medium text-gray-900 mb-2\">\n {t(\"jdi.document_selection.info_title\")}\n </h3>\n <div className=\"text-sm text-gray-700 space-y-1\">\n <p>{t(\"jdi.document_upload.info_point1\")}</p>\n <p>{t(\"jdi.document_upload.info_point2\")}</p>\n <p>{t(\"jdi.document_upload.info_point3\")}</p>\n </div>\n </div>\n )}\n </div>\n </div>\n </MobilePageLayout>\n );\n};\n\nexport default DocumentCollectionSelection;\n"],"names":["useI18n","useState","useEffect","_jsx","MobilePageLayout","PageActions","Button","_jsxs","Title","Subtitle","Select"],"mappings":";;;;;;;;;;;;;;AAiCA,IAAM,2BAA2B,GAAG,UAAC,EAOF,EAAA;AANjC,IAAA,IAAA,UAAU,GAAA,EAAA,CAAA,UAAA,CAAA,CACV,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,oBAAoB,GAAA,EAAA,CAAA,oBAAA,CAAA,wBACA,CAAA,CACV,EAAA,CAAA,UAAA,CAAA,KACV,iBAAiB,GAAA,EAAA,CAAA;AAET,IAAA,IAAA,CAAC,GAAKA,eAAO,EAAE,EAAd;IACH,IAAA,EAAA,GAAkDC,cAAQ,CAAS,EAAE,CAAC,EAArE,oBAAoB,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,uBAAuB,GAAA,EAAA,CAAA,CAAA,CAAwB;AAE5E,IAAAC,eAAS,CAAC,YAAA;QACR,IAAI,oBAAoB,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,oBAAoB,EAAE;YAC5D,uBAAuB,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD;AACF,IAAA,CAAC,EAAE,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,CAAC;IAEhD,IAAM,KAAK,GACT,CAAA,iBAAiB,aAAjB,iBAAiB,KAAA,MAAA,GAAA,MAAA,GAAjB,iBAAiB,CAAE,KAAK;QACxB,CAAC,CAAC,iCAAiC,CAAC;IACtC,IAAM,WAAW,GACf,CAAA,iBAAiB,aAAjB,iBAAiB,K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F,eAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,MAAM,EAAA,QAAA,EAAA,CACnBJ,0BAAO,SAAS,EAAC,8CAA8C,EAAA,QAAA,EAC5D,CAAC,CAAC,uCAAuC,CAAC,GACrC,EACRA,cAAA,CAACO,sBAAM,EAAA,EACL,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,oBAAoB,EAC3B,aAAa,EAAE,UAAC,KAAK,EAAA,EAAK,OAAA,uBAAuB,CAAC,KAAK,CAAC,CAAA,CAA9B,CAA8B,EACxD,WAAW,EAAE,CAAC,CAAC,6CAA6C,CAAC,EAAA,CAC7D,CAAA,EAAA,CACE,EAGL,oBAAoB,KACnBH,yBAAK,SAAS,EAAC,uDAAuD,EAAA,QAAA,EAAA,CACpEJ,cAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,gCAAgC,YAC3C,CAAC,CAAC,mCAAmC,CAAC,EAAA,CACpC,EACLI,eAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,iCAAiC,EAAA,QAAA,EAAA,CAC9CJ,cAAA,CAAA,GAAA,EAAA,EAAA,QAAA,EAAI,CAAC,CAAC,iCAAiC,CAAC,EAAA,CAAK,EAC7CA,gCAAI,CAAC,CAAC,iCAAiC,CAAC,EAAA,CAAK,EAC7CA,cAAA,CAAA,GAAA,EAAA,EAAA,QAAA,EAAI,CAAC,CAAC,iCAAiC,CAAC,GAAK,CAAA,EAAA,CACzC,CAAA,EAAA,CACF,CACP,CAAA,EAAA,CACG,EAAA,CACF,EAAA,CACW;AAEvB;;;;"}
|
|
@@ -152,7 +152,7 @@ var DocumentCollectionUpload = function (_a) {
|
|
|
152
152
|
? t("jdi.processing.download")
|
|
153
153
|
: requiresTwoSides()
|
|
154
154
|
? t("jdi.document_upload.validate_multiple")
|
|
155
|
-
: t("jdi.document_upload.validate_single") }), secondary: jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: onBack, disabled: isUploading, children: t("buttons.back") }) }), children: jsxRuntime.jsx("div", { className: "flex-1 flex items-start justify-center md:items-center p-4", children: jsxRuntime.jsxs("div", { className: "w-full max-w-lg", children: [jsxRuntime.jsxs("div", { className: "text-center mb-8", children: [jsxRuntime.jsx("h1", { className: "text-2xl md:text-3xl font-bold text-gray-900 mb-2", children: t("document_upload.upload_title") }), jsxRuntime.jsx("p", { className: "text-gray-600", children: t("document_upload.upload_description") })] }), error && (jsxRuntime.jsx("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg text-sm text-red-700", children: error })), jsxRuntime.jsx(Card.Card, { className: "border-2 border-dashed border-teal-300 bg-teal-50/30 p-8 mb-6 text-center", onDragOver: function (e) { return e.preventDefault(); }, onDrop: function (e) {
|
|
155
|
+
: t("jdi.document_upload.validate_single") }), secondary: onBack ? (jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: onBack, disabled: isUploading, children: t("buttons.back") })) : undefined }), children: jsxRuntime.jsx("div", { className: "flex-1 flex items-start justify-center md:items-center p-4", children: jsxRuntime.jsxs("div", { className: "w-full max-w-lg", children: [jsxRuntime.jsxs("div", { className: "text-center mb-8", children: [jsxRuntime.jsx("h1", { className: "text-2xl md:text-3xl font-bold text-gray-900 mb-2", children: t("document_upload.upload_title") }), jsxRuntime.jsx("p", { className: "text-gray-600", children: t("document_upload.upload_description") })] }), error && (jsxRuntime.jsx("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg text-sm text-red-700", children: error })), jsxRuntime.jsx(Card.Card, { className: "border-2 border-dashed border-teal-300 bg-teal-50/30 p-8 mb-6 text-center", onDragOver: function (e) { return e.preventDefault(); }, onDrop: function (e) {
|
|
156
156
|
e.preventDefault();
|
|
157
157
|
var files = e.dataTransfer.files;
|
|
158
158
|
if (files.length > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentCollectionUpload.js","sources":["../../../../../src/components/document-collection/DocumentCollectionUpload.tsx"],"sourcesContent":["import React, { useState, useRef } from \"react\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport Button from \"../ui/Button\";\nimport PageActions from \"../ui/PageActions\";\nimport { Card } from \"../ui/Card\";\nimport { Upload } from \"lucide-react\";\nimport PDFPreview from \"../ui/PDFPreview\";\nimport type { onUploadFiles } from \"../../types/uploadFiles\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\nimport { DocumentTypeSide } from \"./DocumentCollection\";\nimport {\n logDocumentLoaded,\n logDocumentsValidated,\n} from \"../../services/auditTrailService\";\n\ninterface AllowedDocumentType {\n id: string;\n name: string;\n side?: DocumentTypeSide;\n}\n\ninterface DocumentCollectionUploadProps {\n onUpload: (files: onUploadFiles) => void;\n onBack: () => void;\n selectedDocumentType: string;\n allowedDocumentTypes: AllowedDocumentType[];\n documentSelection?: {\n title?: string;\n description?: string;\n };\n sessionId?: string;\n}\n\nconst DocumentCollectionUpload = ({\n onUpload,\n onBack,\n selectedDocumentType,\n allowedDocumentTypes,\n documentSelection,\n sessionId,\n}: DocumentCollectionUploadProps) => {\n const { t } = useI18n();\n const [frontImage, setFrontImage] = useState<string | null>(null);\n const [backImage, setBackImage] = useState<string | null>(null);\n const [frontIsPDF, setFrontIsPDF] = useState<boolean>(false);\n const [backIsPDF, setBackIsPDF] = useState<boolean>(false);\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\n const requiresTwoSides = (): boolean => {\n const selected = allowedDocumentTypes.find(\n (d) => d.id === selectedDocumentType,\n );\n return selected?.side === \"RECTO_VERSO\";\n };\n\n const getSelectedDocumentName = () => {\n const selectedDoc = allowedDocumentTypes.find(\n (doc) => doc.id === selectedDocumentType,\n );\n if (!selectedDoc) return \"document\";\n return t(selectedDoc.name) || selectedDoc.name;\n };\n\n const handleFileChange = (\n event: React.ChangeEvent<HTMLInputElement>,\n side: \"front\" | \"back\" = \"front\",\n ) => {\n const file = event.target.files?.[0];\n if (!file) return;\n\n if (\n !file.type.startsWith(\"image/\") &&\n !file.type.startsWith(\"application/pdf\")\n ) {\n setError(t(\"document_upload.errors.invalid_file_type\"));\n return;\n }\n if (file.size > 10 * 1024 * 1024) {\n setError(t(\"document_upload.errors.file_too_large\"));\n return;\n }\n\n setError(\"\");\n const isFilePDF = file.type === \"application/pdf\";\n const reader = new FileReader();\n reader.onload = (e) => {\n const result = e.target?.result as string;\n if (side === \"front\") {\n setFrontImage(result);\n setFrontIsPDF(isFilePDF);\n } else {\n setBackImage(result);\n setBackIsPDF(isFilePDF);\n }\n };\n reader.readAsDataURL(file);\n };\n\n const handleMultipleFileChange = (\n event: React.ChangeEvent<HTMLInputElement>,\n ) => {\n const files = event.target.files;\n if (!files) return;\n const maxFiles = requiresTwoSides() ? 2 : 1;\n if (files.length > maxFiles) {\n setError(t(\"document_upload.errors.max_files\"));\n return;\n }\n setError(\"\");\n Array.from(files).forEach((file, index) => {\n if (\n !file.type.startsWith(\"image/\") &&\n !file.type.startsWith(\"application/pdf\")\n ) {\n setError(t(\"document_upload.errors.invalid_file_type\"));\n return;\n }\n if (file.size > 10 * 1024 * 1024) {\n setError(t(\"document_upload.errors.file_too_large\"));\n return;\n }\n const isFilePDF = file.type === \"application/pdf\";\n const reader = new FileReader();\n reader.onload = (e) => {\n const result = e.target?.result as string;\n if (index === 0) {\n setFrontImage(result);\n setFrontIsPDF(isFilePDF);\n } else if (index === 1 && requiresTwoSides()) {\n setBackImage(result);\n setBackIsPDF(isFilePDF);\n }\n };\n reader.readAsDataURL(file);\n });\n };\n\n const handleUpload = async () => {\n setError(\"\");\n if (!frontImage) {\n setError(t(\"jdi.document_upload.errors.add_photo_identity\"));\n return;\n }\n\n setIsUploading(true);\n try {\n const files = {\n front: frontImage,\n back: requiresTwoSides() ? backImage : null,\n };\n if (sessionId) {\n logDocumentLoaded(sessionId, \"recto\");\n if (requiresTwoSides() && backImage) {\n logDocumentLoaded(sessionId, \"verso\");\n }\n logDocumentsValidated(sessionId);\n }\n onUpload(files);\n } catch (err) {\n setError(t(\"document_upload.errors.upload_error\"));\n setIsUploading(false);\n }\n };\n\n const removeImage = (side: \"front\" | \"back\" = \"front\") => {\n if (side === \"front\") {\n setFrontImage(null);\n setFrontIsPDF(false);\n } else {\n setBackImage(null);\n setBackIsPDF(false);\n }\n setError(\"\");\n };\n\n return (\n <MobilePageLayout\n footer={\n <PageActions\n primary={\n <Button\n onClick={handleUpload}\n disabled={!frontImage || isUploading}\n >\n {isUploading\n ? t(\"jdi.processing.download\")\n : requiresTwoSides()\n ? t(\"jdi.document_upload.validate_multiple\")\n : t(\"jdi.document_upload.validate_single\")}\n </Button>\n }\n secondary={\n <Button variant=\"secondary\" onClick={onBack} disabled={isUploading}>\n {t(\"buttons.back\")}\n </Button>\n }\n />\n }\n >\n <div className=\"flex-1 flex items-start justify-center md:items-center p-4\">\n <div className=\"w-full max-w-lg\">\n <div className=\"text-center mb-8\">\n <h1 className=\"text-2xl md:text-3xl font-bold text-gray-900 mb-2\">\n {t(\"document_upload.upload_title\")}\n </h1>\n <p className=\"text-gray-600\">\n {t(\"document_upload.upload_description\")}\n </p>\n </div>\n\n {error && (\n <div className=\"mb-6 p-4 bg-red-50 border border-red-200 rounded-lg text-sm text-red-700\">\n {error}\n </div>\n )}\n\n <Card\n className=\"border-2 border-dashed border-teal-300 bg-teal-50/30 p-8 mb-6 text-center\"\n onDragOver={(e) => e.preventDefault()}\n onDrop={(e) => {\n e.preventDefault();\n const files = e.dataTransfer.files;\n if (files.length > 0) {\n const syntheticEvent = { target: { files } } as any;\n requiresTwoSides() ? handleMultipleFileChange(syntheticEvent) : handleFileChange(syntheticEvent);\n }\n }}\n >\n {!frontImage ? (\n <div className=\"space-y-6\">\n <h3 className=\"text-lg font-semibold text-gray-900\">{getSelectedDocumentName()}</h3>\n <Button\n onClick={() => requiresTwoSides() ? multipleInputRef.current?.click() : frontInputRef.current?.click()}\n className=\"bg-teal-600 text-white hover:bg-teal-700 px-6 py-2 rounded-lg font-medium mx-auto flex items-center gap-2\"\n disabled={isUploading}\n >\n <Upload size={18} />\n <span>{t(\"document_upload.browse_files\")}</span>\n </Button>\n <div className=\"text-xs text-gray-500 space-y-1\">\n <p>{t(\"document_upload.accepted_formats\")}</p>\n <p>{requiresTwoSides() ? t(\"document_upload.multiple_files_info\") : t(\"document_upload.single_file_info\")}</p>\n </div>\n </div>\n ) : (\n <div className=\"space-y-4\">\n <div className=\"bg-white border rounded-lg p-4 relative group\">\n <p className=\"text-sm font-medium mb-1\">{frontIsPDF ? t(\"document_upload.pdf_preview\") : t(\"document_upload.image_preview\")}</p>\n {frontIsPDF ? <PDFPreview src={frontImage} /> : <img src={frontImage} alt={t(\"document_upload.front_side\")} className=\"max-h-48 mx-auto\" />}\n <button onClick={() => removeImage(\"front\")} className=\"absolute top-2 right-2 text-red-500 hover:text-red-700\">✕</button>\n </div>\n {requiresTwoSides() && backImage && (\n <div className=\"bg-white border rounded-lg p-4 relative group\">\n <p className=\"text-sm font-medium mb-1\">{t(\"document_upload.back_side\")} {backIsPDF ? \"PDF\" : \"\"}</p>\n {backIsPDF ? <PDFPreview src={backImage} /> : <img src={backImage} alt={t(\"document_upload.back_side\")} className=\"max-h-48 mx-auto\" />}\n <button onClick={() => removeImage(\"back\")} className=\"absolute top-2 right-2 text-red-500 hover:text-red-700\">✕</button>\n </div>\n )}\n {requiresTwoSides() && !backImage && (\n <Button\n onClick={() => {\n const input = document.createElement(\"input\");\n input.type = \"file\";\n input.accept = \"image/*,.pdf\";\n input.onchange = (e) => handleFileChange(e as any, \"back\");\n input.click();\n }}\n className=\"text-teal-600 border border-teal-600 bg-transparent hover:bg-teal-50 w-full\"\n >\n {t(\"document_upload.add_back\")}\n </Button>\n )}\n </div>\n )}\n </Card>\n\n <input ref={frontInputRef} type=\"file\" accept=\"image/*,.pdf\" onChange={(e) => handleFileChange(e, \"front\")} className=\"hidden\" />\n <input ref={multipleInputRef} type=\"file\" accept=\"image/*,.pdf\" multiple={true} onChange={handleMultipleFileChange} className=\"hidden\" />\n </div>\n </div>\n </MobilePageLayout>\n );\n};\n\nexport default DocumentCollectionUpload;\n"],"names":["useI18n","useState","useRef","__awaiter","logDocumentLoaded","logDocumentsValidated","_jsx","MobilePageLayout","PageActions","Button","_jsxs","Card","Upload","PDFPreview"],"mappings":";;;;;;;;;;;;;;;;AAmCA,IAAM,wBAAwB,GAAG,UAAC,EAOF,EAAA;AAN5B,IAAA,IAAA,QAAQ,GAAA,EAAA,CAAA,QAAA,CAAA,CACR,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,oBAAoB,GAAA,EAAA,CAAA,oBAAA,CAAA,CACpB,oBAAoB,0BAAA,CAAA,CACH,EAAA,CAAA,iBAAA,CAAA,KACjB,SAAS,GAAA,EAAA,CAAA;AAED,IAAA,IAAA,CAAC,GAAKA,eAAO,EAAE,EAAd;IACH,IAAA,EAAA,GAA8BC,cAAQ,CAAgB,IAAI,CAAC,EAA1D,UAAU,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,aAAa,GAAA,EAAA,CAAA,CAAA,CAAiC;IAC3D,IAAA,EAAA,GAA4BA,cAAQ,CAAgB,IAAI,CAAC,EAAxD,SAAS,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,YAAY,GAAA,EAAA,CAAA,CAAA,CAAiC;IACzD,IAAA,EAAA,GAA8BA,cAAQ,CAAU,KAAK,CAAC,EAArD,UAAU,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,aAAa,GAAA,EAAA,CAAA,CAAA,CAA4B;IACtD,IAAA,EAAA,GAA4BA,cAAQ,CAAU,KAAK,CAAC,EAAnD,SAAS,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,YAAY,GAAA,EAAA,CAAA,CAAA,CAA4B;IACpD,IAAA,EAAA,GAAgCA,cAAQ,CAAC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AAC,EAA5B,CAA4B,EAAE,SAAS,EAAC,QAAQ,EAAA,CAAG,EACjIA,cAAA,CAAA,OAAA,EAAA,EAAO,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,EAAC,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,wBAAwB,EAAE,SAAS,EAAC,QAAQ,EAAA,CAAG,IACvI,EAAA,CACJ,EAAA,CACS;AAE3B;;;;"}
|
|
1
|
+
{"version":3,"file":"DocumentCollectionUpload.js","sources":["../../../../../src/components/document-collection/DocumentCollectionUpload.tsx"],"sourcesContent":["import React, { useState, useRef } from \"react\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport Button from \"../ui/Button\";\nimport PageActions from \"../ui/PageActions\";\nimport { Card } from \"../ui/Card\";\nimport { Upload } from \"lucide-react\";\nimport PDFPreview from \"../ui/PDFPreview\";\nimport type { onUploadFiles } from \"../../types/uploadFiles\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\nimport { DocumentTypeSide } from \"./DocumentCollection\";\nimport {\n logDocumentLoaded,\n logDocumentsValidated,\n} from \"../../services/auditTrailService\";\n\ninterface AllowedDocumentType {\n id: string;\n name: string;\n side?: DocumentTypeSide;\n}\n\ninterface DocumentCollectionUploadProps {\n onUpload: (files: onUploadFiles) => void;\n onBack?: () => void;\n selectedDocumentType: string;\n allowedDocumentTypes: AllowedDocumentType[];\n documentSelection?: {\n title?: string;\n description?: string;\n };\n sessionId?: string;\n}\n\nconst DocumentCollectionUpload = ({\n onUpload,\n onBack,\n selectedDocumentType,\n allowedDocumentTypes,\n documentSelection,\n sessionId,\n}: DocumentCollectionUploadProps) => {\n const { t } = useI18n();\n const [frontImage, setFrontImage] = useState<string | null>(null);\n const [backImage, setBackImage] = useState<string | null>(null);\n const [frontIsPDF, setFrontIsPDF] = useState<boolean>(false);\n const [backIsPDF, setBackIsPDF] = useState<boolean>(false);\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\n const requiresTwoSides = (): boolean => {\n const selected = allowedDocumentTypes.find(\n (d) => d.id === selectedDocumentType,\n );\n return selected?.side === \"RECTO_VERSO\";\n };\n\n const getSelectedDocumentName = () => {\n const selectedDoc = allowedDocumentTypes.find(\n (doc) => doc.id === selectedDocumentType,\n );\n if (!selectedDoc) return \"document\";\n return t(selectedDoc.name) || selectedDoc.name;\n };\n\n const handleFileChange = (\n event: React.ChangeEvent<HTMLInputElement>,\n side: \"front\" | \"back\" = \"front\",\n ) => {\n const file = event.target.files?.[0];\n if (!file) return;\n\n if (\n !file.type.startsWith(\"image/\") &&\n !file.type.startsWith(\"application/pdf\")\n ) {\n setError(t(\"document_upload.errors.invalid_file_type\"));\n return;\n }\n if (file.size > 10 * 1024 * 1024) {\n setError(t(\"document_upload.errors.file_too_large\"));\n return;\n }\n\n setError(\"\");\n const isFilePDF = file.type === \"application/pdf\";\n const reader = new FileReader();\n reader.onload = (e) => {\n const result = e.target?.result as string;\n if (side === \"front\") {\n setFrontImage(result);\n setFrontIsPDF(isFilePDF);\n } else {\n setBackImage(result);\n setBackIsPDF(isFilePDF);\n }\n };\n reader.readAsDataURL(file);\n };\n\n const handleMultipleFileChange = (\n event: React.ChangeEvent<HTMLInputElement>,\n ) => {\n const files = event.target.files;\n if (!files) return;\n const maxFiles = requiresTwoSides() ? 2 : 1;\n if (files.length > maxFiles) {\n setError(t(\"document_upload.errors.max_files\"));\n return;\n }\n setError(\"\");\n Array.from(files).forEach((file, index) => {\n if (\n !file.type.startsWith(\"image/\") &&\n !file.type.startsWith(\"application/pdf\")\n ) {\n setError(t(\"document_upload.errors.invalid_file_type\"));\n return;\n }\n if (file.size > 10 * 1024 * 1024) {\n setError(t(\"document_upload.errors.file_too_large\"));\n return;\n }\n const isFilePDF = file.type === \"application/pdf\";\n const reader = new FileReader();\n reader.onload = (e) => {\n const result = e.target?.result as string;\n if (index === 0) {\n setFrontImage(result);\n setFrontIsPDF(isFilePDF);\n } else if (index === 1 && requiresTwoSides()) {\n setBackImage(result);\n setBackIsPDF(isFilePDF);\n }\n };\n reader.readAsDataURL(file);\n });\n };\n\n const handleUpload = async () => {\n setError(\"\");\n if (!frontImage) {\n setError(t(\"jdi.document_upload.errors.add_photo_identity\"));\n return;\n }\n\n setIsUploading(true);\n try {\n const files = {\n front: frontImage,\n back: requiresTwoSides() ? backImage : null,\n };\n if (sessionId) {\n logDocumentLoaded(sessionId, \"recto\");\n if (requiresTwoSides() && backImage) {\n logDocumentLoaded(sessionId, \"verso\");\n }\n logDocumentsValidated(sessionId);\n }\n onUpload(files);\n } catch (err) {\n setError(t(\"document_upload.errors.upload_error\"));\n setIsUploading(false);\n }\n };\n\n const removeImage = (side: \"front\" | \"back\" = \"front\") => {\n if (side === \"front\") {\n setFrontImage(null);\n setFrontIsPDF(false);\n } else {\n setBackImage(null);\n setBackIsPDF(false);\n }\n setError(\"\");\n };\n\n return (\n <MobilePageLayout\n footer={\n <PageActions\n primary={\n <Button\n onClick={handleUpload}\n disabled={!frontImage || isUploading}\n >\n {isUploading\n ? t(\"jdi.processing.download\")\n : requiresTwoSides()\n ? t(\"jdi.document_upload.validate_multiple\")\n : t(\"jdi.document_upload.validate_single\")}\n </Button>\n }\n secondary={onBack ? (\n <Button variant=\"secondary\" onClick={onBack} disabled={isUploading}>\n {t(\"buttons.back\")}\n </Button>\n ) : undefined}\n />\n }\n >\n <div className=\"flex-1 flex items-start justify-center md:items-center p-4\">\n <div className=\"w-full max-w-lg\">\n <div className=\"text-center mb-8\">\n <h1 className=\"text-2xl md:text-3xl font-bold text-gray-900 mb-2\">\n {t(\"document_upload.upload_title\")}\n </h1>\n <p className=\"text-gray-600\">\n {t(\"document_upload.upload_description\")}\n </p>\n </div>\n\n {error && (\n <div className=\"mb-6 p-4 bg-red-50 border border-red-200 rounded-lg text-sm text-red-700\">\n {error}\n </div>\n )}\n\n <Card\n className=\"border-2 border-dashed border-teal-300 bg-teal-50/30 p-8 mb-6 text-center\"\n onDragOver={(e) => e.preventDefault()}\n onDrop={(e) => {\n e.preventDefault();\n const files = e.dataTransfer.files;\n if (files.length > 0) {\n const syntheticEvent = { target: { files } } as any;\n requiresTwoSides() ? handleMultipleFileChange(syntheticEvent) : handleFileChange(syntheticEvent);\n }\n }}\n >\n {!frontImage ? (\n <div className=\"space-y-6\">\n <h3 className=\"text-lg font-semibold text-gray-900\">{getSelectedDocumentName()}</h3>\n <Button\n onClick={() => requiresTwoSides() ? multipleInputRef.current?.click() : frontInputRef.current?.click()}\n className=\"bg-teal-600 text-white hover:bg-teal-700 px-6 py-2 rounded-lg font-medium mx-auto flex items-center gap-2\"\n disabled={isUploading}\n >\n <Upload size={18} />\n <span>{t(\"document_upload.browse_files\")}</span>\n </Button>\n <div className=\"text-xs text-gray-500 space-y-1\">\n <p>{t(\"document_upload.accepted_formats\")}</p>\n <p>{requiresTwoSides() ? t(\"document_upload.multiple_files_info\") : t(\"document_upload.single_file_info\")}</p>\n </div>\n </div>\n ) : (\n <div className=\"space-y-4\">\n <div className=\"bg-white border rounded-lg p-4 relative group\">\n <p className=\"text-sm font-medium mb-1\">{frontIsPDF ? t(\"document_upload.pdf_preview\") : t(\"document_upload.image_preview\")}</p>\n {frontIsPDF ? <PDFPreview src={frontImage} /> : <img src={frontImage} alt={t(\"document_upload.front_side\")} className=\"max-h-48 mx-auto\" />}\n <button onClick={() => removeImage(\"front\")} className=\"absolute top-2 right-2 text-red-500 hover:text-red-700\">✕</button>\n </div>\n {requiresTwoSides() && backImage && (\n <div className=\"bg-white border rounded-lg p-4 relative group\">\n <p className=\"text-sm font-medium mb-1\">{t(\"document_upload.back_side\")} {backIsPDF ? \"PDF\" : \"\"}</p>\n {backIsPDF ? <PDFPreview src={backImage} /> : <img src={backImage} alt={t(\"document_upload.back_side\")} className=\"max-h-48 mx-auto\" />}\n <button onClick={() => removeImage(\"back\")} className=\"absolute top-2 right-2 text-red-500 hover:text-red-700\">✕</button>\n </div>\n )}\n {requiresTwoSides() && !backImage && (\n <Button\n onClick={() => {\n const input = document.createElement(\"input\");\n input.type = \"file\";\n input.accept = \"image/*,.pdf\";\n input.onchange = (e) => handleFileChange(e as any, \"back\");\n input.click();\n }}\n className=\"text-teal-600 border border-teal-600 bg-transparent hover:bg-teal-50 w-full\"\n >\n {t(\"document_upload.add_back\")}\n </Button>\n )}\n </div>\n )}\n </Card>\n\n <input ref={frontInputRef} type=\"file\" accept=\"image/*,.pdf\" onChange={(e) => handleFileChange(e, \"front\")} className=\"hidden\" />\n <input ref={multipleInputRef} type=\"file\" accept=\"image/*,.pdf\" multiple={true} onChange={handleMultipleFileChange} className=\"hidden\" />\n </div>\n </div>\n </MobilePageLayout>\n );\n};\n\nexport default DocumentCollectionUpload;\n"],"names":["useI18n","useState","useRef","__awaiter","logDocumentLoaded","logDocumentsValidated","_jsx","MobilePageLayout","PageActions","Button","_jsxs","Card","Upload","PDFPreview"],"mappings":";;;;;;;;;;;;;;;;AAmCA,IAAM,wBAAwB,GAAG,UAAC,EAOF,EAAA;AAN5B,IAAA,IAAA,QAAQ,GAAA,EAAA,CAAA,QAAA,CAAA,CACR,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,oBAAoB,GAAA,EAAA,CAAA,oBAAA,CAAA,CACpB,oBAAoB,0BAAA,CAAA,CACH,EAAA,CAAA,iBAAA,CAAA,KACjB,SAAS,GAAA,EAAA,CAAA;AAED,IAAA,IAAA,CAAC,GAAKA,eAAO,EAAE,EAAd;IACH,IAAA,EAAA,GAA8BC,cAAQ,CAAgB,IAAI,CAAC,EAA1D,UAAU,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,aAAa,GAAA,EAAA,CAAA,CAAA,CAAiC;IAC3D,IAAA,EAAA,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AAM;AACnB,wCAAA,KAAK,CAAC,MAAM,GAAG,cAAc;AAC7B,wCAAA,KAAK,CAAC,QAAQ,GAAG,UAAC,CAAC,EAAA,EAAK,OAAA,gBAAgB,CAAC,CAAQ,EAAE,MAAM,CAAC,CAAA,CAAlC,CAAkC;wCAC1D,KAAK,CAAC,KAAK,EAAE;AACjB,oCAAA,CAAC,EACD,SAAS,EAAC,6EAA6E,EAAA,QAAA,EAEtF,CAAC,CAAC,0BAA0B,CAAC,EAAA,CACzB,CACZ,CAAA,EAAA,CACC,CACT,EAAA,CACE,EAEPH,0BAAO,GAAG,EAAE,aAAa,EAAE,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,EAAC,QAAQ,EAAE,UAAC,CAAC,EAAA,EAAK,OAAA,gBAAgB,CAAC,CAAC,EAAE,OAAO,CAAC,EAA5B,CAA4B,EAAE,SAAS,EAAC,QAAQ,EAAA,CAAG,EACjIA,cAAA,CAAA,OAAA,EAAA,EAAO,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,EAAC,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,wBAAwB,EAAE,SAAS,EAAC,QAAQ,EAAA,CAAG,IACvI,EAAA,CACJ,EAAA,CACS;AAE3B;;;;"}
|
|
@@ -71,7 +71,7 @@ var JDICountrySelection = function (_a) {
|
|
|
71
71
|
return t("jdi.country_selection.subtitle_identity");
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
|
-
return (jsxRuntime.jsx(MobilePageLayout.default, { footer: jsxRuntime.jsx(PageActions.default, { primary: jsxRuntime.jsx(Button.default, { onClick: handleContinue, disabled: !selectedCountry, children: t("jdi.country_selection.continue") }), secondary: jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: onBack, children: t("jdi.country_selection.back") }) }), 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: countryIntroText || getTitle() }), jsxRuntime.jsx(Subtitle.default, { className: "text-sm text-gray-600 leading-relaxed", children: countryDescText || getSubtitle() })] }), jsxRuntime.jsxs("div", { className: "space-y-4", children: [jsxRuntime.jsxs("div", { className: "space-y-2", children: [jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700", children: t("jdi.country_selection.country_label") }), jsxRuntime.jsx(SelectComponent.Select, { value: selectedCountry, onValueChange: function (value) {
|
|
74
|
+
return (jsxRuntime.jsx(MobilePageLayout.default, { footer: jsxRuntime.jsx(PageActions.default, { primary: jsxRuntime.jsx(Button.default, { onClick: handleContinue, disabled: !selectedCountry, children: t("jdi.country_selection.continue") }), secondary: onBack ? (jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: onBack, children: t("jdi.country_selection.back") })) : undefined }), 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: countryIntroText || getTitle() }), jsxRuntime.jsx(Subtitle.default, { className: "text-sm text-gray-600 leading-relaxed", children: countryDescText || getSubtitle() })] }), jsxRuntime.jsxs("div", { className: "space-y-4", children: [jsxRuntime.jsxs("div", { className: "space-y-2", children: [jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700", children: t("jdi.country_selection.country_label") }), jsxRuntime.jsx(SelectComponent.Select, { value: selectedCountry, onValueChange: function (value) {
|
|
75
75
|
setSelectedCountry(value);
|
|
76
76
|
setError("");
|
|
77
77
|
}, placeholder: t("jdi.country_selection.country_placeholder"), options: countries ? countries : [], allowCustomValue: true }), error && jsxRuntime.jsx("p", { className: "text-sm text-red-600 mt-1", children: error })] }), 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("jdi.country_selection.info_title") }), jsxRuntime.jsx("p", { className: "text-sm text-blue-800", children: t("jdi.country_selection.info_description") })] })] })] }) }) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JDICountrySelection.js","sources":["../../../../../src/components/jdi/JDICountrySelection.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport Button from \"../ui/Button\";\nimport PageActions from \"../ui/PageActions\";\nimport { Select } from \"../ui/SelectComponent\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport { AcceptedCountry } from \"../../types/session\";\nimport { getCountryInfo } from \"../../utils/jdiCountry\";\nimport { ISO_COUNTRY_CODES } from \"../../utils/isoCountryCodes\";\nimport { getCountryFlag } from \"../../utils/countryFlags\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\n\nconst DEFAULT_COUNTRIES = [\n { value: \"FR\", label: \"France\" },\n { value: \"ES\", label: \"Espagne\" },\n { value: \"PT\", label: \"Portugal\" },\n { value: \"DE\", label: \"Allemagne\" },\n { value: \"IT\", label: \"Italie\" },\n { value: \"BE\", label: \"Belgique\" },\n { value: \"NL\", label: \"Pays-Bas\" },\n { value: \"CH\", label: \"Suisse\" },\n { value: \"LU\", label: \"Luxembourg\" },\n { value: \"AT\", label: \"Autriche\" },\n];\n\nconst INTERNATIONAL_COUNTRY = {\n value: \"INT\",\n labelKey: \"jdi.countrySelection.international\",\n fallbackLabel: \"International\",\n};\n\ninterface JDICountrySelectionProps {\n onCountrySelect: (countryId: string) => void;\n onBack: () => void;\n documentTypeId?: string;\n acceptedCountries?: AcceptedCountry[];\n countryIntroText?: string;\n countryDescText?: string;\n}\n\nconst JDICountrySelection = ({\n onCountrySelect,\n onBack,\n documentTypeId,\n acceptedCountries,\n countryIntroText,\n countryDescText,\n}: JDICountrySelectionProps) => {\n const [selectedCountry, setSelectedCountry] = useState<string>(\"\");\n const [error, setError] = useState<string>(\"\");\n const { t } = useI18n();\n\n const countries = useMemo(() => {\n if (acceptedCountries && acceptedCountries.length > 0) {\n const countries = acceptedCountries\n .filter((country) => country.code)\n .map((country) => ({\n value: country.code,\n label: t(country.code),\n flag: getCountryFlag(country.code),\n }))\n .sort((a, b) => a.label.localeCompare(b.label));\n return countries;\n }\n }, [acceptedCountries, t]);\n\n useEffect(() => {\n if (!countries?.length) {\n return;\n }\n\n const hasSelectedCountry = countries.some(\n (country) => country.value === selectedCountry\n );\n\n if (!hasSelectedCountry) {\n const initialCountry = countries.length === 1 ? countries[0].value : \"\";\n setSelectedCountry(initialCountry);\n setError(\"\");\n }\n }, [countries, selectedCountry]);\n\n const handleContinue = () => {\n if (!selectedCountry) {\n setError(t(\"jdi.country_selection.error_select_country\"));\n return;\n }\n setError(\"\");\n onCountrySelect(selectedCountry);\n };\n\n // Déterminer le titre en fonction du type de document\n const getTitle = () => {\n switch (documentTypeId) {\n case \"jdd\":\n return t(\"jdi.country_selection.title_jdd\");\n case \"income-proof\":\n return t(\"jdi.country_selection.title_income_proof\");\n default:\n return t(\"jdi.country_selection.title_identity\");\n }\n };\n\n const getSubtitle = () => {\n switch (documentTypeId) {\n case \"jdd\":\n return t(\"jdi.country_selection.subtitle_jdd\");\n case \"income-proof\":\n return t(\"jdi.country_selection.subtitle_income_proof\");\n default:\n return t(\"jdi.country_selection.subtitle_identity\");\n }\n };\n\n return (\n <MobilePageLayout\n footer={\n <PageActions\n primary={\n <Button onClick={handleContinue} disabled={!selectedCountry}>\n {t(\"jdi.country_selection.continue\")}\n </Button>\n }\n secondary={\n <Button variant=\"secondary\" onClick={onBack}>\n {t(\"jdi.country_selection.back\")}\n </Button>\n }\n />\n }\n >\n <div className=\"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 {/* Header */}\n <div className=\"text-center space-y-4\">\n <Title className=\"text-xl md:text-2xl lg:text-3xl\">\n {countryIntroText || getTitle()}\n </Title>\n <Subtitle className=\"text-sm text-gray-600 leading-relaxed\">\n {countryDescText || getSubtitle()}\n </Subtitle>\n </div>\n\n {/* Country selection */}\n <div className=\"space-y-4\">\n <div className=\"space-y-2\">\n <label className=\"block text-sm font-medium text-gray-700\">\n {t(\"jdi.country_selection.country_label\")}\n </label>\n <Select\n value={selectedCountry}\n onValueChange={(value: string) => {\n setSelectedCountry(value);\n setError(\"\");\n }}\n placeholder={t(\"jdi.country_selection.country_placeholder\")}\n options={countries ? countries : []}\n allowCustomValue={true}\n />\n {error && <p className=\"text-sm text-red-600 mt-1\">{error}</p>}\n </div>\n\n {/* Information card */}\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(\"jdi.country_selection.info_title\")}\n </h3>\n <p className=\"text-sm text-blue-800\">\n {t(\"jdi.country_selection.info_description\")}\n </p>\n </div>\n </div>\n </div>\n </div>\n </MobilePageLayout>\n );\n};\n\nexport default JDICountrySelection;\n"],"names":["useState","useI18n","useMemo","getCountryFlag","useEffect","_jsx","MobilePageLayout","PageActions","Button","_jsxs","Title","Subtitle","Select"],"mappings":";;;;;;;;;;;;;;;AAyCA,IAAM,mBAAmB,GAAG,UAAC,EAOF,EAAA;AANzB,IAAA,IAAA,eAAe,GAAA,EAAA,CAAA,eAAA,EACf,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,cAAc,GAAA,EAAA,CAAA,cAAA,EACd,iBAAiB,uBAAA,EACjB,gBAAgB,GAAA,EAAA,CAAA,gBAAA,EAChB,eAAe,GAAA,EAAA,CAAA,eAAA;IAET,IAAA,EAAA,GAAwCA,cAAQ,CAAS,EAAE,CAAC,EAA3D,eAAe,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,kBAAkB,GAAA,EAAA,CAAA,CAAA,CAAwB;IA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G,SAAS,EAAC,2BAA2B,YAAE,KAAK,EAAA,CAAK,CAAA,EAAA,CAC1D,EAGNI,eAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,kDAAkD,aAC/DJ,cAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,gCAAgC,EAAA,QAAA,EAC3C,CAAC,CAAC,kCAAkC,CAAC,EAAA,CACnC,EACLA,cAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,uBAAuB,EAAA,QAAA,EACjC,CAAC,CAAC,wCAAwC,CAAC,EAAA,CAC1C,CAAA,EAAA,CACA,CAAA,EAAA,CACF,CAAA,EAAA,CACF,EAAA,CACF,EAAA,CACW;AAEvB;;;;"}
|
|
1
|
+
{"version":3,"file":"JDICountrySelection.js","sources":["../../../../../src/components/jdi/JDICountrySelection.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport Button from \"../ui/Button\";\nimport PageActions from \"../ui/PageActions\";\nimport { Select } from \"../ui/SelectComponent\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport { AcceptedCountry } from \"../../types/session\";\nimport { getCountryInfo } from \"../../utils/jdiCountry\";\nimport { ISO_COUNTRY_CODES } from \"../../utils/isoCountryCodes\";\nimport { getCountryFlag } from \"../../utils/countryFlags\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\n\nconst DEFAULT_COUNTRIES = [\n { value: \"FR\", label: \"France\" },\n { value: \"ES\", label: \"Espagne\" },\n { value: \"PT\", label: \"Portugal\" },\n { value: \"DE\", label: \"Allemagne\" },\n { value: \"IT\", label: \"Italie\" },\n { value: \"BE\", label: \"Belgique\" },\n { value: \"NL\", label: \"Pays-Bas\" },\n { value: \"CH\", label: \"Suisse\" },\n { value: \"LU\", label: \"Luxembourg\" },\n { value: \"AT\", label: \"Autriche\" },\n];\n\nconst INTERNATIONAL_COUNTRY = {\n value: \"INT\",\n labelKey: \"jdi.countrySelection.international\",\n fallbackLabel: \"International\",\n};\n\ninterface JDICountrySelectionProps {\n onCountrySelect: (countryId: string) => void;\n onBack?: () => void;\n documentTypeId?: string;\n acceptedCountries?: AcceptedCountry[];\n countryIntroText?: string;\n countryDescText?: string;\n}\n\nconst JDICountrySelection = ({\n onCountrySelect,\n onBack,\n documentTypeId,\n acceptedCountries,\n countryIntroText,\n countryDescText,\n}: JDICountrySelectionProps) => {\n const [selectedCountry, setSelectedCountry] = useState<string>(\"\");\n const [error, setError] = useState<string>(\"\");\n const { t } = useI18n();\n\n const countries = useMemo(() => {\n if (acceptedCountries && acceptedCountries.length > 0) {\n const countries = acceptedCountries\n .filter((country) => country.code)\n .map((country) => ({\n value: country.code,\n label: t(country.code),\n flag: getCountryFlag(country.code),\n }))\n .sort((a, b) => a.label.localeCompare(b.label));\n return countries;\n }\n }, [acceptedCountries, t]);\n\n useEffect(() => {\n if (!countries?.length) {\n return;\n }\n\n const hasSelectedCountry = countries.some(\n (country) => country.value === selectedCountry\n );\n\n if (!hasSelectedCountry) {\n const initialCountry = countries.length === 1 ? countries[0].value : \"\";\n setSelectedCountry(initialCountry);\n setError(\"\");\n }\n }, [countries, selectedCountry]);\n\n const handleContinue = () => {\n if (!selectedCountry) {\n setError(t(\"jdi.country_selection.error_select_country\"));\n return;\n }\n setError(\"\");\n onCountrySelect(selectedCountry);\n };\n\n // Déterminer le titre en fonction du type de document\n const getTitle = () => {\n switch (documentTypeId) {\n case \"jdd\":\n return t(\"jdi.country_selection.title_jdd\");\n case \"income-proof\":\n return t(\"jdi.country_selection.title_income_proof\");\n default:\n return t(\"jdi.country_selection.title_identity\");\n }\n };\n\n const getSubtitle = () => {\n switch (documentTypeId) {\n case \"jdd\":\n return t(\"jdi.country_selection.subtitle_jdd\");\n case \"income-proof\":\n return t(\"jdi.country_selection.subtitle_income_proof\");\n default:\n return t(\"jdi.country_selection.subtitle_identity\");\n }\n };\n\n return (\n <MobilePageLayout\n footer={\n <PageActions\n primary={\n <Button onClick={handleContinue} disabled={!selectedCountry}>\n {t(\"jdi.country_selection.continue\")}\n </Button>\n }\n secondary={onBack ? (\n <Button variant=\"secondary\" onClick={onBack}>\n {t(\"jdi.country_selection.back\")}\n </Button>\n ) : undefined}\n />\n }\n >\n <div className=\"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 {/* Header */}\n <div className=\"text-center space-y-4\">\n <Title className=\"text-xl md:text-2xl lg:text-3xl\">\n {countryIntroText || getTitle()}\n </Title>\n <Subtitle className=\"text-sm text-gray-600 leading-relaxed\">\n {countryDescText || getSubtitle()}\n </Subtitle>\n </div>\n\n {/* Country selection */}\n <div className=\"space-y-4\">\n <div className=\"space-y-2\">\n <label className=\"block text-sm font-medium text-gray-700\">\n {t(\"jdi.country_selection.country_label\")}\n </label>\n <Select\n value={selectedCountry}\n onValueChange={(value: string) => {\n setSelectedCountry(value);\n setError(\"\");\n }}\n placeholder={t(\"jdi.country_selection.country_placeholder\")}\n options={countries ? countries : []}\n allowCustomValue={true}\n />\n {error && <p className=\"text-sm text-red-600 mt-1\">{error}</p>}\n </div>\n\n {/* Information card */}\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(\"jdi.country_selection.info_title\")}\n </h3>\n <p className=\"text-sm text-blue-800\">\n {t(\"jdi.country_selection.info_description\")}\n </p>\n </div>\n </div>\n </div>\n </div>\n </MobilePageLayout>\n );\n};\n\nexport default JDICountrySelection;\n"],"names":["useState","useI18n","useMemo","getCountryFlag","useEffect","_jsx","MobilePageLayout","PageActions","Button","_jsxs","Title","Subtitle","Select"],"mappings":";;;;;;;;;;;;;;;AAyCA,IAAM,mBAAmB,GAAG,UAAC,EAOF,EAAA;AANzB,IAAA,IAAA,eAAe,GAAA,EAAA,CAAA,eAAA,EACf,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,cAAc,GAAA,EAAA,CAAA,cAAA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AC;4CACzB,QAAQ,CAAC,EAAE,CAAC;AACd,wCAAA,CAAC,EACD,WAAW,EAAE,CAAC,CAAC,2CAA2C,CAAC,EAC3D,OAAO,EAAE,SAAS,GAAG,SAAS,GAAG,EAAE,EACnC,gBAAgB,EAAE,IAAI,EAAA,CACtB,EACD,KAAK,IAAIP,cAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,2BAA2B,YAAE,KAAK,EAAA,CAAK,CAAA,EAAA,CAC1D,EAGNI,eAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,kDAAkD,aAC/DJ,cAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,gCAAgC,EAAA,QAAA,EAC3C,CAAC,CAAC,kCAAkC,CAAC,EAAA,CACnC,EACLA,cAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,uBAAuB,EAAA,QAAA,EACjC,CAAC,CAAC,wCAAwC,CAAC,EAAA,CAC1C,CAAA,EAAA,CACA,CAAA,EAAA,CACF,CAAA,EAAA,CACF,EAAA,CACF,EAAA,CACW;AAEvB;;;;"}
|
|
@@ -173,7 +173,7 @@ var JDIDocumentSelection = function (_a) {
|
|
|
173
173
|
];
|
|
174
174
|
}
|
|
175
175
|
};
|
|
176
|
-
return (jsxRuntime.jsx(MobilePageLayout.default, { contentClassName: "h-full", footer: jsxRuntime.jsx(PageActions.default, { primary: jsxRuntime.jsx(Button.default, { onClick: handleContinue, disabled: !selectedDocument, children: t("jdi.document_selection.continue") }), secondary: jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: onBack, children: t("jdi.document_selection.back") }) }), 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: documentSelectionTitle || getTitle() }), jsxRuntime.jsx(Subtitle.default, { className: "text-sm text-gray-600 leading-relaxed whitespace-pre-line", children: documentSelectionDescription || getSubtitle() })] }), jsxRuntime.jsxs("div", { className: "space-y-4", children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: [getLabel(), " *"] }), jsxRuntime.jsx(SelectComponent.Select, { options: documentOptions, value: selectedDocument, onValueChange: function (value) {
|
|
176
|
+
return (jsxRuntime.jsx(MobilePageLayout.default, { contentClassName: "h-full", footer: jsxRuntime.jsx(PageActions.default, { primary: jsxRuntime.jsx(Button.default, { onClick: handleContinue, disabled: !selectedDocument, children: t("jdi.document_selection.continue") }), secondary: onBack ? (jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: onBack, children: t("jdi.document_selection.back") })) : undefined }), 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: documentSelectionTitle || getTitle() }), jsxRuntime.jsx(Subtitle.default, { className: "text-sm text-gray-600 leading-relaxed whitespace-pre-line", children: documentSelectionDescription || getSubtitle() })] }), jsxRuntime.jsxs("div", { className: "space-y-4", children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: [getLabel(), " *"] }), jsxRuntime.jsx(SelectComponent.Select, { options: documentOptions, value: selectedDocument, onValueChange: function (value) {
|
|
177
177
|
setSelectedDocument(value);
|
|
178
178
|
setError("");
|
|
179
179
|
}, placeholder: getPlaceholder() }), error && (jsxRuntime.jsxs("p", { className: "mt-1 text-sm text-red-600 flex items-center", children: [jsxRuntime.jsx("span", { className: "mr-1", children: "\u26A0" }), error] }))] }), selectedDocument && !nfcEnabled && (jsxRuntime.jsxs("div", { className: "bg-gray-50 border border-gray-200 rounded-lg p-4", children: [jsxRuntime.jsx("h3", { className: "font-medium text-gray-900 mb-2", children: t("jdi.document_selection.info_title") }), jsxRuntime.jsx("div", { className: "text-sm text-gray-700 space-y-1", children: getInstructions().map(function (instruction, index) { return (jsxRuntime.jsx("p", { children: instruction }, index)); }) })] })), nfcEnabled && jsxRuntime.jsx(NfcOnboardingNotice.default, {})] })] }) }) }));
|