datakeen-session-react 1.1.195-dev.5 → 1.1.195-dev.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/cjs/components/document-collection/DocumentError.js +5 -1
  2. package/dist/cjs/components/document-collection/DocumentError.js.map +1 -1
  3. package/dist/cjs/components/document-collection/DocumentProcessing.js +13 -11
  4. package/dist/cjs/components/document-collection/DocumentProcessing.js.map +1 -1
  5. package/dist/cjs/components/document-video/document-video-flow/DocumentVideoProcessing.js +9 -5
  6. package/dist/cjs/components/document-video/document-video-flow/DocumentVideoProcessing.js.map +1 -1
  7. package/dist/cjs/components/jdi/JDIError.js +5 -1
  8. package/dist/cjs/components/jdi/JDIError.js.map +1 -1
  9. package/dist/cjs/components/jdi/JDIProcessing.js +15 -14
  10. package/dist/cjs/components/jdi/JDIProcessing.js.map +1 -1
  11. package/dist/cjs/components/selfie/Video.js +2 -2
  12. package/dist/cjs/components/selfie/Video.js.map +1 -1
  13. package/dist/cjs/components/selfie/selfie-flow/SelfieFlow.js +2 -2
  14. package/dist/cjs/components/selfie/selfie-flow/SelfieFlow.js.map +1 -1
  15. package/dist/cjs/components/selfie/selfie-flow/SelfieProcessing.js +5 -1
  16. package/dist/cjs/components/selfie/selfie-flow/SelfieProcessing.js.map +1 -1
  17. package/dist/cjs/components/selfie/selfie-flow/SelfieRecorder.js +123 -13
  18. package/dist/cjs/components/selfie/selfie-flow/SelfieRecorder.js.map +1 -1
  19. package/dist/cjs/components/session/Selfie.js +1 -1
  20. package/dist/cjs/components/session/Selfie.js.map +1 -1
  21. package/dist/cjs/i18n/en.json.js +3 -1
  22. package/dist/cjs/i18n/en.json.js.map +1 -1
  23. package/dist/cjs/i18n/es.json.js +3 -1
  24. package/dist/cjs/i18n/es.json.js.map +1 -1
  25. package/dist/cjs/i18n/fr.json.js +3 -1
  26. package/dist/cjs/i18n/fr.json.js.map +1 -1
  27. package/dist/cjs/services/analysis.js +40 -26
  28. package/dist/cjs/services/analysis.js.map +1 -1
  29. package/dist/cjs/services/iadService.js +30 -0
  30. package/dist/cjs/services/iadService.js.map +1 -0
  31. package/dist/cjs/types/session.js.map +1 -1
  32. package/dist/cjs/utils/analysisErrors.js +33 -12
  33. package/dist/cjs/utils/analysisErrors.js.map +1 -1
  34. package/dist/esm/components/document-collection/DocumentError.js +5 -1
  35. package/dist/esm/components/document-collection/DocumentError.js.map +1 -1
  36. package/dist/esm/components/document-collection/DocumentProcessing.js +14 -12
  37. package/dist/esm/components/document-collection/DocumentProcessing.js.map +1 -1
  38. package/dist/esm/components/document-video/document-video-flow/DocumentVideoProcessing.js +9 -5
  39. package/dist/esm/components/document-video/document-video-flow/DocumentVideoProcessing.js.map +1 -1
  40. package/dist/esm/components/jdi/JDIError.js +5 -1
  41. package/dist/esm/components/jdi/JDIError.js.map +1 -1
  42. package/dist/esm/components/jdi/JDIProcessing.js +16 -15
  43. package/dist/esm/components/jdi/JDIProcessing.js.map +1 -1
  44. package/dist/esm/components/selfie/Video.js +2 -2
  45. package/dist/esm/components/selfie/Video.js.map +1 -1
  46. package/dist/esm/components/selfie/selfie-flow/SelfieFlow.js +2 -2
  47. package/dist/esm/components/selfie/selfie-flow/SelfieFlow.js.map +1 -1
  48. package/dist/esm/components/selfie/selfie-flow/SelfieProcessing.js +5 -1
  49. package/dist/esm/components/selfie/selfie-flow/SelfieProcessing.js.map +1 -1
  50. package/dist/esm/components/selfie/selfie-flow/SelfieRecorder.js +124 -14
  51. package/dist/esm/components/selfie/selfie-flow/SelfieRecorder.js.map +1 -1
  52. package/dist/esm/components/session/Selfie.js +1 -1
  53. package/dist/esm/components/session/Selfie.js.map +1 -1
  54. package/dist/esm/i18n/en.json.js +3 -1
  55. package/dist/esm/i18n/en.json.js.map +1 -1
  56. package/dist/esm/i18n/es.json.js +3 -1
  57. package/dist/esm/i18n/es.json.js.map +1 -1
  58. package/dist/esm/i18n/fr.json.js +3 -1
  59. package/dist/esm/i18n/fr.json.js.map +1 -1
  60. package/dist/esm/services/analysis.js +40 -26
  61. package/dist/esm/services/analysis.js.map +1 -1
  62. package/dist/esm/services/iadService.js +28 -0
  63. package/dist/esm/services/iadService.js.map +1 -0
  64. package/dist/esm/types/session.js.map +1 -1
  65. package/dist/esm/utils/analysisErrors.js +30 -12
  66. package/dist/esm/utils/analysisErrors.js.map +1 -1
  67. package/docs/POLLING_SYSTEM.md +4 -0
  68. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SelfieRecorder.js","sources":["../../../../../../src/components/selfie/selfie-flow/SelfieRecorder.tsx"],"sourcesContent":["import {\n useCallback,\n useRef,\n useState,\n useEffect,\n type ElementRef,\n} from \"react\";\nimport { AcquisitionPreset, VideoRecorder } from \"@unissey-web/sdk-react\";\nimport Button from \"../../ui/Button\";\nimport Title from \"../../ui/Title\";\nimport Subtitle from \"../../ui/Subtitle\";\nimport useVideoRecorderStyles from \"../hooks/useVideoRecorderStyles\";\nimport { setupVideoElementsObserver } from \"../utils/videoElementStyles\";\nimport { delay, isIOS, waitForVideoFrame, getRecorderVideoElement } from \"../utils/selfieCaptureUtils\";\nimport { useLiveFrameCapture } from \"../hooks/useLiveFrameCapture\";\nimport { useI18n } from \"../../../hooks/useI18n\";\nimport useIsMobile from \"../../../hooks/useIsMobile\";\nimport { getUnisseyStrings } from \"../utils/unisseyStrings\";\n\ntype RecordingState = \"idle\" | \"preparing\" | \"recording\" | \"processing\";\n\ninterface SelfieRecorderProps {\n handleSelfie: (e: Event) => void;\n onBeginCapture?: () => void;\n isCapturing?: boolean;\n btnBg?: string;\n btnText?: string;\n}\n\ntype VideoRecorderElement = ElementRef<typeof VideoRecorder>;\n\nconst SelfieRecorder = ({\n handleSelfie,\n onBeginCapture = () => { },\n btnBg,\n btnText,\n}: SelfieRecorderProps) => {\n const { t } = useI18n();\n const isMobile = useIsMobile(768);\n const recorderRef = useRef<VideoRecorderElement | null>(null);\n const [disableButton, setDisableButton] = useState(false);\n const [recorderReady, setRecorderReady] = useState(false);\n const [recordingState, setRecordingState] = useState<RecordingState>(\"idle\");\n const recordingStateRef = useRef<RecordingState>(\"idle\");\n const lastRecorderStatusRef = useRef<string | undefined>();\n const capturedThumbnailRef = useRef<string | null>(null);\n const { captureFrame, cleanup } = useLiveFrameCapture();\n\n useVideoRecorderStyles(btnBg, btnText);\n\n const updateRecordingState = useCallback((state: RecordingState) => {\n recordingStateRef.current = state;\n setRecordingState(state);\n }, []);\n\n const resetCaptureControls = useCallback(() => {\n capturedThumbnailRef.current = null;\n updateRecordingState(\"idle\");\n setDisableButton(false);\n }, [updateRecordingState]);\n\n // Réinitialisation déclenchée par le polling de statut Unissey.\n // Pendant une capture en cours (preparing/recording/processing), les transitions\n // internes du cycle d'enregistrement (starting → running → ready) ne doivent PAS\n // réactiver le bouton. Seule une perte réelle de la caméra (passage par\n // \"no-session\") justifie un reset pendant la capture (scénario retry caméra).\n const resetCaptureControlsFromPolling = useCallback(\n (previousStatus: string | undefined) => {\n if (\n recordingStateRef.current !== \"idle\" &&\n previousStatus !== \"no-session\"\n ) {\n return;\n }\n resetCaptureControls();\n },\n [resetCaptureControls]\n );\n\n useEffect(() => {\n document.body.classList.add(\"recording-selfie\");\n const cleanupObserver = setupVideoElementsObserver();\n\n // Les traducteurs automatiques (Safari iOS notamment) réécrivent le DOM et\n // détruisent les marqueurs de template Lit du web component Unissey : la capture\n // ne redémarre alors plus jamais. React sérialise `translate` en propriété DOM sur\n // un custom element (d'où un translate=\"yes\" parasite), il faut poser l'attribut\n // impérativement.\n document\n .querySelectorAll(\"uni-video-recorder\")\n .forEach((el) => el.setAttribute(\"translate\", \"no\"));\n\n // iOS-specific fix: Add required attributes to video elements after mount\n if (isIOS()) {\n const addIOSVideoAttributes = () => {\n const videoRecorders = document.querySelectorAll(\"uni-video-recorder\");\n videoRecorders.forEach((recorder) => {\n // Try to access shadow DOM and video elements\n try {\n const shadowRoot = recorder.shadowRoot;\n if (shadowRoot) {\n const videoElements = shadowRoot.querySelectorAll(\"video\");\n videoElements.forEach((video: HTMLVideoElement) => {\n video.setAttribute(\"playsinline\", \"true\");\n video.setAttribute(\"autoplay\", \"true\");\n video.setAttribute(\"muted\", \"true\");\n // Ensure video plays inline and autoplays\n video.playsInline = true;\n video.autoplay = true;\n video.muted = true;\n });\n }\n } catch (error) {\n console.log(\"Could not access shadow DOM:\", error);\n }\n\n // Also set attributes on the component itself\n recorder.setAttribute(\"playsinline\", \"true\");\n recorder.setAttribute(\"autoplay\", \"true\");\n recorder.setAttribute(\"muted\", \"true\");\n });\n };\n\n // Apply immediately and also after a delay to catch dynamically created elements\n addIOSVideoAttributes();\n const iosTimeout = setTimeout(addIOSVideoAttributes, 500);\n const iosInterval = setInterval(addIOSVideoAttributes, 1000);\n\n return () => {\n document.body.classList.remove(\"recording-selfie\");\n cleanupObserver();\n cleanup();\n clearTimeout(iosTimeout);\n clearInterval(iosInterval);\n };\n }\n\n return () => {\n document.body.classList.remove(\"recording-selfie\");\n cleanupObserver();\n cleanup();\n };\n }, [cleanup]);\n\n const recordStarting = () => {\n if (!recorderReady || recordingState !== \"idle\") return;\n onBeginCapture();\n updateRecordingState(\"preparing\");\n setDisableButton(true);\n\n const triggerCapture = async () => {\n try {\n await waitForVideoFrame(recorderRef.current);\n await delay(200);\n updateRecordingState(\"recording\");\n\n // Capture a frame from the live video during recording (after a short delay)\n setTimeout(() => {\n const videoElement = getRecorderVideoElement(recorderRef.current);\n if (videoElement) {\n const thumbnail = captureFrame(videoElement);\n capturedThumbnailRef.current = thumbnail;\n }\n }, 1000); // Capture frame 1 second into recording\n\n recorderRef.current?.capture();\n } catch (error) {\n console.error(\"SelfieRecorder: failed to capture frame\", error);\n updateRecordingState(\"idle\");\n setDisableButton(false);\n }\n };\n\n void triggerCapture();\n };\n\n useEffect(() => {\n const interval = setInterval(() => {\n const status = recorderRef.current?.sdkJsStatus;\n const isReady = status === \"ready\" || status === \"running\";\n setRecorderReady((prev) => (prev !== isReady ? isReady : prev));\n\n const previousStatus = lastRecorderStatusRef.current;\n const wasReady = previousStatus === \"ready\" || previousStatus === \"running\";\n if (status !== previousStatus) {\n lastRecorderStatusRef.current = status;\n if (isReady && previousStatus !== undefined && !wasReady) {\n resetCaptureControlsFromPolling(previousStatus);\n }\n }\n }, 500);\n return () => clearInterval(interval);\n }, [resetCaptureControlsFromPolling]);\n\n const handleRecorderReady = () => {\n setRecorderReady(true);\n resetCaptureControls();\n };\n\n const handleRecordInterrupted = () => {\n resetCaptureControls();\n };\n\n const handleRecordCompleted = (e: Event) => {\n const customEvent = e as CustomEvent<{ media?: Blob; metadata?: string }>;\n if (!customEvent.detail?.media || customEvent.detail.media.size === 0) {\n console.error(\"❌ No valid media captured\");\n\n // iOS-specific debugging\n if (isIOS()) {\n console.log(\"🍎 iOS detected - checking video elements for proper attributes\");\n const videoRecorders = document.querySelectorAll(\"uni-video-recorder\");\n videoRecorders.forEach((recorder, index) => {\n console.log(`VideoRecorder ${index}:`, {\n playsinline: recorder.getAttribute(\"playsinline\"),\n autoplay: recorder.getAttribute(\"autoplay\"),\n muted: recorder.getAttribute(\"muted\")\n });\n });\n }\n\n updateRecordingState(\"idle\");\n setDisableButton(false);\n return;\n }\n\n // Attach the captured thumbnail to the event\n const enhancedEvent = new CustomEvent('record-completed', {\n detail: {\n media: customEvent.detail.media,\n metadata: customEvent.detail.metadata || '',\n thumbnail: capturedThumbnailRef.current || undefined,\n }\n });\n\n updateRecordingState(\"processing\");\n handleSelfie(enhancedEvent);\n };\n\n return (\n <div\n className=\"selfie selfie-recorder-root notranslate flex flex-col\"\n translate=\"no\"\n style={{\n [\"--dk-btn-bg\" as string]: btnBg ?? \"#11E5C5\",\n [\"--dk-btn-text\" as string]: btnText ?? \"#3C3C40\",\n position: isMobile ? \"fixed\" : \"relative\",\n inset: isMobile ? 0 : \"auto\",\n zIndex: isMobile ? 50 : \"auto\",\n height: \"100%\",\n width: \"100%\",\n }}\n >\n <div className=\"p-4 text-center bg-white shrink-0\">\n <Title className=\"text-lg md:text-xl mb-1\">{t(\"selfie.recorder.title\")}</Title>\n <Subtitle className=\"text-xs text-gray-600 md:text-sm\">{t(\"selfie.recorder.subtitle\")}</Subtitle>\n </div>\n\n <div className=\"video-container flex-1 relative overflow-hidden\">\n <VideoRecorder\n ref={recorderRef}\n preset={AcquisitionPreset.SELFIE_OPTIMIZED}\n hideCaptureBtn\n faceChecker={(typeof window !== 'undefined' && window.__E2E_DISABLE_FACE_CHECKER__) ? 'disabled' : 'enabled'}\n disableDebugMode\n onRecorderReady={handleRecorderReady}\n onRecordInterrupted={handleRecordInterrupted}\n onRecordCompleted={handleRecordCompleted}\n style={{ width: \"100%\", height: \"100%\" }}\n className=\"video-recorder-no-radius notranslate w-full h-full\"\n {...(isIOS() && {\n \"data-playsinline\": \"true\",\n \"data-autoplay\": \"true\",\n \"data-muted\": \"true\"\n })}\n strings={getUnisseyStrings(t)}\n />\n </div>\n\n <div className=\"shrink-0 bg-white border-t border-gray-200 p-4 md:p-6 relative\" style={{ zIndex: 9999 }}>\n <div className=\"max-w-md mx-auto\">\n <div className=\"text-center text-xs text-gray-400 mt-3\">\n {t(\"selfie.recorder.note\")}\n </div>\n\n <Button\n onClick={recordStarting}\n className=\"w-full py-3 md:py-4 relative selfie-button\"\n disabled={disableButton || !recorderReady}\n style={{ backgroundColor: btnBg ?? \"#11E5C5\", color: btnText ?? \"#3C3C40\" }}\n >\n {recordingState === \"idle\" && t(\"selfie.recorder.start\")}\n {recordingState === \"preparing\" && t(\"selfie.recorder.preparing\")}\n {recordingState === \"recording\" && (\n <span className=\"flex items-center justify-center\">\n <span className=\"mr-2\">{t(\"selfie.recorder.recording_label\")}</span>\n <span className=\"flex space-x-1 loading-dots\">\n <span className=\"h-1 w-1 bg-white rounded-full\"></span>\n <span className=\"h-1 w-1 bg-white rounded-full\"></span>\n <span className=\"h-1 w-1 bg-white rounded-full\"></span>\n </span>\n </span>\n )}\n {recordingState === \"processing\" && t(\"selfie.recorder.processing\")}\n </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,MAAM,EAAA,QAAA,EAAE,CAAC,CAAC,iCAAiC,CAAC,EAAA,CAAQ,EACpED,IAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,6BAA6B,EAAA,QAAA,EAAA,CAC3CC,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,+BAA+B,EAAA,CAAQ,EACvDA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,+BAA+B,EAAA,CAAQ,EACvDA,cAAM,SAAS,EAAC,+BAA+B,EAAA,CAAQ,IAClD,CAAA,EAAA,CACF,CACR,EACA,cAAc,KAAK,YAAY,IAAI,CAAC,CAAC,4BAA4B,CAAC,CAAA,EAAA,CAC5D,IACL,EAAA,CACF,CAAA,EAAA,CACF;AAEV;;;;"}
1
+ {"version":3,"file":"SelfieRecorder.js","sources":["../../../../../../src/components/selfie/selfie-flow/SelfieRecorder.tsx"],"sourcesContent":["import {\n useCallback,\n useMemo,\n useRef,\n useState,\n useEffect,\n type ElementRef,\n} from \"react\";\nimport {\n AcquisitionPreset,\n VideoRecorder,\n type IadConfig,\n} from \"@unissey-web/sdk-react\";\nimport Button from \"../../ui/Button\";\nimport Title from \"../../ui/Title\";\nimport Subtitle from \"../../ui/Subtitle\";\nimport useVideoRecorderStyles from \"../hooks/useVideoRecorderStyles\";\nimport { setupVideoElementsObserver } from \"../utils/videoElementStyles\";\nimport { delay, isIOS, waitForVideoFrame, getRecorderVideoElement } from \"../utils/selfieCaptureUtils\";\nimport { useLiveFrameCapture } from \"../hooks/useLiveFrameCapture\";\nimport { useI18n } from \"../../../hooks/useI18n\";\nimport useIsMobile from \"../../../hooks/useIsMobile\";\nimport { getUnisseyStrings } from \"../utils/unisseyStrings\";\nimport { prepareIadCapture } from \"../../../services/iadService\";\n\ntype RecordingState = \"idle\" | \"preparing\" | \"recording\" | \"processing\";\n\ninterface SelfieRecorderProps {\n handleSelfie: (e: Event) => void;\n onBeginCapture?: () => void;\n sessionId?: string;\n iad?: { enabled: boolean; level?: \"basic\" | \"reinforced\" };\n isCapturing?: boolean;\n btnBg?: string;\n btnText?: string;\n}\n\ntype VideoRecorderElement = ElementRef<typeof VideoRecorder>;\ntype VideoRecorderWithError = VideoRecorderElement & { error?: string };\n\n/** Préparation IAD mémorisée pour une session (donnée à usage unique). */\ntype PreparedIadSession = {\n sessionId: string;\n preparation?: IadConfig;\n};\n\nconst SelfieRecorder = ({\n handleSelfie,\n onBeginCapture = () => { },\n sessionId,\n iad,\n btnBg,\n btnText,\n}: SelfieRecorderProps) => {\n const { t } = useI18n();\n const isMobile = useIsMobile(768);\n const recorderRef = useRef<VideoRecorderElement | null>(null);\n const [disableButton, setDisableButton] = useState(false);\n const [recorderReady, setRecorderReady] = useState(false);\n const [recordingState, setRecordingState] = useState<RecordingState>(\"idle\");\n const [iadConfig, setIadConfig] = useState<IadConfig>();\n const [iadPreparationDone, setIadPreparationDone] = useState(\n iad?.enabled !== true,\n );\n const [captureError, setCaptureError] = useState<string>();\n /**\n * Préparation IAD déjà demandée pour une session, avec son résultat.\n * `preparation` reste indéfini tant que la requête n'a pas abouti.\n */\n const preparedSessionRef = useRef<PreparedIadSession>();\n const recordingStateRef = useRef<RecordingState>(\"idle\");\n const lastRecorderStatusRef = useRef<string | undefined>();\n const capturedThumbnailRef = useRef<string | null>(null);\n const { captureFrame, cleanup } = useLiveFrameCapture();\n\n useVideoRecorderStyles(btnBg, btnText);\n\n useEffect(() => {\n let cancelled = false;\n\n if (iad?.enabled !== true || !sessionId) {\n setIadConfig(undefined);\n setIadPreparationDone(true);\n return () => {\n cancelled = true;\n };\n }\n\n /**\n * La donnée de préparation est à USAGE UNIQUE : une seconde requête invalide\n * la première et provoque des suspicions d'injection systématiques (doc\n * Unissey, « False rejections possible root causes »). On ne prépare donc\n * qu'une fois par session — ce garde neutralise aussi le double montage du\n * StrictMode en développement.\n */\n /**\n * La préparation est mémorisée par session : on ne redemande pas de donnée\n * (usage unique côté Unissey), mais on réapplique le résultat déjà obtenu.\n *\n * C'est indispensable avec le double montage du StrictMode : au premier\n * montage la requête part puis le démontage annule l'application du\n * résultat ; sans réapplication ici, `iadPreparationDone` resterait\n * définitivement `false` et le recorder ne serait jamais monté.\n */\n const cached = preparedSessionRef.current;\n if (cached?.sessionId === sessionId) {\n if (cached.preparation) setIadConfig(cached.preparation);\n setIadPreparationDone(true);\n return () => {\n cancelled = true;\n };\n }\n\n const entry: PreparedIadSession = { sessionId };\n preparedSessionRef.current = entry;\n\n setIadConfig(undefined);\n setIadPreparationDone(false);\n void prepareIadCapture(sessionId)\n .then((preparation) => {\n const config: IadConfig = {\n mode: preparation.mode,\n data: preparation.data,\n };\n // Mémorisé même si ce montage est annulé : le montage suivant le\n // réappliquera sans consommer une nouvelle donnée.\n entry.preparation = config;\n if (!cancelled) setIadConfig(config);\n })\n .catch((error: unknown) => {\n // Seul le message est loggué : l'objet d'erreur Axios embarque la\n // requête (en-têtes d'authentification, URL avec identifiant de session).\n console.warn(\n \"[IAD prepare failed]\",\n error instanceof Error ? error.message : \"unknown error\",\n );\n // Fail open for capture: the backend will keep the IAD verdict\n // inconclusive if a trustworthy signal cannot be produced.\n // Aucune donnée n'a été consommée : on libère le garde pour permettre\n // une nouvelle tentative au prochain montage.\n if (preparedSessionRef.current === entry) {\n preparedSessionRef.current = undefined;\n }\n })\n .finally(() => {\n // Volontairement sans garde `cancelled` : le drapeau doit passer à\n // `true` même si ce montage est annulé, sinon le recorder reste bloqué.\n setIadPreparationDone(true);\n });\n\n return () => {\n cancelled = true;\n };\n }, [iad?.enabled, sessionId]);\n\n /**\n * La prop `config` doit être STABLE entre les rendus.\n *\n * `VideoRecorder` est un web-component Lit : un nouvel objet à chaque rendu\n * est vu comme une prop modifiée, ce qui réinitialise le recorder — il\n * recharge alors ses modules WASM et redemande une préparation IAD, en\n * boucle. Sans ce mémo, l'écran de capture ne devient jamais prêt.\n */\n /**\n * L'IAD est-elle attendue pour cette capture ET techniquement obtenable ?\n *\n * Sert à retarder le montage du recorder jusqu'à ce que `iadConfig` soit\n * prête. Repasse à `false` si la préparation a échoué (`preparedSessionRef`\n * libéré par le `catch`) : la capture démarre alors sans IAD plutôt que de\n * rester bloquée — le backend produira un verdict `inconclusive`.\n */\n const recorderConfig = useMemo(\n () => (iadConfig ? { iadConfig } : undefined),\n [iadConfig],\n );\n\n const updateRecordingState = useCallback((state: RecordingState) => {\n recordingStateRef.current = state;\n setRecordingState(state);\n }, []);\n\n const resetCaptureControls = useCallback(() => {\n capturedThumbnailRef.current = null;\n updateRecordingState(\"idle\");\n setDisableButton(false);\n }, [updateRecordingState]);\n\n // Réinitialisation déclenchée par le polling de statut Unissey.\n // Pendant une capture en cours (preparing/recording/processing), les transitions\n // internes du cycle d'enregistrement (starting → running → ready) ne doivent PAS\n // réactiver le bouton. Seule une perte réelle de la caméra (passage par\n // \"no-session\") justifie un reset pendant la capture (scénario retry caméra).\n const resetCaptureControlsFromPolling = useCallback(\n (previousStatus: string | undefined) => {\n if (\n recordingStateRef.current !== \"idle\" &&\n previousStatus !== \"no-session\"\n ) {\n return;\n }\n resetCaptureControls();\n },\n [resetCaptureControls]\n );\n\n useEffect(() => {\n document.body.classList.add(\"recording-selfie\");\n const cleanupObserver = setupVideoElementsObserver();\n\n // iOS-specific fix: Add required attributes to video elements after mount\n if (isIOS()) {\n const addIOSVideoAttributes = () => {\n const videoRecorders = document.querySelectorAll(\"uni-video-recorder\");\n videoRecorders.forEach((recorder) => {\n // Try to access shadow DOM and video elements\n try {\n const shadowRoot = recorder.shadowRoot;\n if (shadowRoot) {\n const videoElements = shadowRoot.querySelectorAll(\"video\");\n videoElements.forEach((video: HTMLVideoElement) => {\n video.setAttribute(\"playsinline\", \"true\");\n video.setAttribute(\"autoplay\", \"true\");\n video.setAttribute(\"muted\", \"true\");\n // Ensure video plays inline and autoplays\n video.playsInline = true;\n video.autoplay = true;\n video.muted = true;\n });\n }\n } catch (error) {\n console.log(\"Could not access shadow DOM:\", error);\n }\n\n // Also set attributes on the component itself\n recorder.setAttribute(\"playsinline\", \"true\");\n recorder.setAttribute(\"autoplay\", \"true\");\n recorder.setAttribute(\"muted\", \"true\");\n });\n };\n\n // Apply immediately and also after a delay to catch dynamically created elements\n addIOSVideoAttributes();\n const iosTimeout = setTimeout(addIOSVideoAttributes, 500);\n const iosInterval = setInterval(addIOSVideoAttributes, 1000);\n\n return () => {\n document.body.classList.remove(\"recording-selfie\");\n cleanupObserver();\n cleanup();\n clearTimeout(iosTimeout);\n clearInterval(iosInterval);\n };\n }\n\n return () => {\n document.body.classList.remove(\"recording-selfie\");\n cleanupObserver();\n cleanup();\n };\n }, [cleanup]);\n\n // Les traducteurs automatiques (Safari iOS notamment) réécrivent le DOM et\n // détruisent les marqueurs de template Lit du web component Unissey : la capture\n // ne redémarre alors plus jamais. React sérialise `translate` en propriété DOM sur\n // un custom element (d'où un translate=\"yes\" parasite), il faut poser l'attribut\n // impérativement. Le recorder n'étant monté qu'une fois la préparation IAD\n // terminée, l'attribut est posé à ce moment-là (et non au montage du composant).\n useEffect(() => {\n if (!iadPreparationDone) return;\n document\n .querySelectorAll(\"uni-video-recorder\")\n .forEach((el) => el.setAttribute(\"translate\", \"no\"));\n }, [iadPreparationDone]);\n\n const recordStarting = () => {\n if (!recorderReady || recordingState !== \"idle\") return;\n onBeginCapture();\n setCaptureError(undefined);\n updateRecordingState(\"preparing\");\n setDisableButton(true);\n\n const triggerCapture = async () => {\n try {\n await waitForVideoFrame(recorderRef.current);\n await delay(200);\n updateRecordingState(\"recording\");\n\n // Capture a frame from the live video during recording (after a short delay)\n setTimeout(() => {\n const videoElement = getRecorderVideoElement(recorderRef.current);\n if (videoElement) {\n const thumbnail = captureFrame(videoElement);\n capturedThumbnailRef.current = thumbnail;\n }\n }, 1000); // Capture frame 1 second into recording\n\n recorderRef.current?.capture();\n } catch (error) {\n console.error(\"SelfieRecorder: failed to capture frame\", error);\n updateRecordingState(\"idle\");\n setDisableButton(false);\n }\n };\n\n void triggerCapture();\n };\n\n useEffect(() => {\n const interval = setInterval(() => {\n const status = recorderRef.current?.sdkJsStatus;\n const isReady = status === \"ready\" || status === \"running\";\n setRecorderReady((prev) => (prev !== isReady ? isReady : prev));\n\n const previousStatus = lastRecorderStatusRef.current;\n const wasReady = previousStatus === \"ready\" || previousStatus === \"running\";\n if (status !== previousStatus) {\n lastRecorderStatusRef.current = status;\n if (isReady && previousStatus !== undefined && !wasReady) {\n resetCaptureControlsFromPolling(previousStatus);\n }\n }\n }, 500);\n return () => clearInterval(interval);\n }, [resetCaptureControlsFromPolling]);\n\n const handleRecorderReady = () => {\n setCaptureError(undefined);\n setRecorderReady(true);\n resetCaptureControls();\n };\n\n const handleRecordInterrupted = () => {\n const recorderError = (recorderRef.current as VideoRecorderWithError | null)?.error;\n setCaptureError(\n recorderError || t(\"unissey.forbiddenActionMessages.default\"),\n );\n resetCaptureControls();\n };\n\n const handleRecordCompleted = (e: Event) => {\n const customEvent = e as CustomEvent<{ media?: Blob; metadata?: string }>;\n if (!customEvent.detail?.media || customEvent.detail.media.size === 0) {\n console.error(\"❌ No valid media captured\");\n\n // iOS-specific debugging\n if (isIOS()) {\n console.log(\"🍎 iOS detected - checking video elements for proper attributes\");\n const videoRecorders = document.querySelectorAll(\"uni-video-recorder\");\n videoRecorders.forEach((recorder, index) => {\n console.log(`VideoRecorder ${index}:`, {\n playsinline: recorder.getAttribute(\"playsinline\"),\n autoplay: recorder.getAttribute(\"autoplay\"),\n muted: recorder.getAttribute(\"muted\")\n });\n });\n }\n\n updateRecordingState(\"idle\");\n setDisableButton(false);\n return;\n }\n\n // Attach the captured thumbnail to the event\n const enhancedEvent = new CustomEvent('record-completed', {\n detail: {\n media: customEvent.detail.media,\n metadata: customEvent.detail.metadata || '',\n thumbnail: capturedThumbnailRef.current || undefined,\n }\n });\n\n updateRecordingState(\"processing\");\n handleSelfie(enhancedEvent);\n };\n\n return (\n <div\n className=\"selfie selfie-recorder-root notranslate flex flex-col\"\n translate=\"no\"\n style={{\n [\"--dk-btn-bg\" as string]: btnBg ?? \"#11E5C5\",\n [\"--dk-btn-text\" as string]: btnText ?? \"#3C3C40\",\n position: isMobile ? \"fixed\" : \"relative\",\n inset: isMobile ? 0 : \"auto\",\n zIndex: isMobile ? 50 : \"auto\",\n height: \"100%\",\n width: \"100%\",\n }}\n >\n <div className=\"p-4 text-center bg-white shrink-0\">\n <Title className=\"text-lg md:text-xl mb-1\">{t(\"selfie.recorder.title\")}</Title>\n <Subtitle className=\"text-xs text-gray-600 md:text-sm\">{t(\"selfie.recorder.subtitle\")}</Subtitle>\n </div>\n\n <div className=\"video-container flex-1 relative overflow-hidden\">\n {/* Le recorder ne doit monter QU'UNE FOIS la config IAD disponible.\n Unissey réinitialise sa session interne dès que la prop `config`\n change (`updated()` → `callInitSession()`). Monter sans config puis\n l'injecter créerait une première session SANS IAD — donc sans\n `selfie-metadata` — avant de la recréer. On attend donc que la\n préparation soit terminée ET, quand l'IAD est active, que sa config\n soit prête. */}\n {iadPreparationDone && (\n <VideoRecorder\n ref={recorderRef}\n preset={AcquisitionPreset.SELFIE_OPTIMIZED}\n hideCaptureBtn\n faceChecker={\n typeof window !== \"undefined\" &&\n window.__E2E_DISABLE_FACE_CHECKER__\n ? \"disabled\"\n : \"enabled\"\n }\n disableDebugMode\n {...(recorderConfig ? { config: recorderConfig } : {})}\n onRecorderReady={handleRecorderReady}\n onRecordInterrupted={handleRecordInterrupted}\n onRecordCompleted={handleRecordCompleted}\n style={{ width: \"100%\", height: \"100%\" }}\n className=\"video-recorder-no-radius notranslate w-full h-full\"\n {...(isIOS() && {\n \"data-playsinline\": \"true\",\n \"data-autoplay\": \"true\",\n \"data-muted\": \"true\",\n })}\n strings={getUnisseyStrings(t)}\n />\n )}\n </div>\n\n {captureError && (\n <div role=\"alert\" className=\"shrink-0 bg-red-50 px-4 py-2 text-center text-sm text-red-700\">\n {captureError}\n </div>\n )}\n\n <div className=\"shrink-0 bg-white border-t border-gray-200 p-4 md:p-6 relative\" style={{ zIndex: 9999 }}>\n <div className=\"max-w-md mx-auto\">\n <div className=\"text-center text-xs text-gray-400 mt-3\">\n {t(\"selfie.recorder.note\")}\n </div>\n\n <Button\n onClick={recordStarting}\n className=\"w-full py-3 md:py-4 relative selfie-button\"\n disabled={disableButton || !recorderReady}\n style={{ backgroundColor: btnBg ?? \"#11E5C5\", color: btnText ?? \"#3C3C40\" }}\n >\n {recordingState === \"idle\" && t(\"selfie.recorder.start\")}\n {recordingState === \"preparing\" && t(\"selfie.recorder.preparing\")}\n {recordingState === \"recording\" && (\n <span className=\"flex items-center justify-center\">\n <span className=\"mr-2\">{t(\"selfie.recorder.recording_label\")}</span>\n <span className=\"flex space-x-1 loading-dots\">\n <span className=\"h-1 w-1 bg-white rounded-full\"></span>\n <span className=\"h-1 w-1 bg-white rounded-full\"></span>\n <span className=\"h-1 w-1 bg-white rounded-full\"></span>\n </span>\n </span>\n )}\n {recordingState === \"processing\" && t(\"selfie.recorder.processing\")}\n </Button>\n </div>\n </div>\n </div>\n );\n};\n\nexport default SelfieRecorder;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;AA8CA,IAAM,cAAc,GAAG,UAAC,EAOF,EAAA;;QANpB,YAAY,GAAA,EAAA,CAAA,YAAA,EACZ,EAAA,GAAA,EAAA,CAAA,cAA0B,EAA1B,cAAc,GAAA,EAAA,KAAA,MAAA,GAAG,YAAA,EAAQ,CAAC,GAAA,EAAA,EAC1B,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,GAAG,GAAA,EAAA,CAAA,GAAA,EACH,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,OAAO,GAAA,EAAA,CAAA,OAAA;AAEC,IAAA,IAAA,CAAC,GAAK,OAAO,EAAE,EAAd;AACT,IAAA,IAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,CAAC;AACjC,IAAA,IAAM,WAAW,GAAG,MAAM,CAA8B,IAAI,CAAC;IACvD,IAAA,EAAA,GAAoC,QAAQ,CAAC,KAAK,CAAC,EAAlD,aAAa,G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GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,+BAA+B,GAAQ,EACvDA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,+BAA+B,GAAQ,EACvDA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,+BAA+B,EAAA,CAAQ,CAAA,EAAA,CAClD,IACF,CACR,EACA,cAAc,KAAK,YAAY,IAAI,CAAC,CAAC,4BAA4B,CAAC,CAAA,EAAA,CAC5D,IACL,EAAA,CACF,CAAA,EAAA,CACF;AAEV;;;;"}
@@ -45,7 +45,7 @@ var Selfie = function (_a) {
45
45
  var handleRetakeSelfie = function () {
46
46
  setInternalStep(0);
47
47
  };
48
- return (jsxs("div", { className: "h-full w-full transition-opacity duration-500 ".concat(isTransitioning ? "opacity-50" : "opacity-100"), children: [internalStep === 0 && (jsx(Video, { setSelfieData: setSelfieData, setStep: setInternalStep, btnBg: (_b = template.buttonBgColor) !== null && _b !== void 0 ? _b : "#11E5C5", btnText: (_c = template.buttonTextColor) !== null && _c !== void 0 ? _c : "#3C3C40" })), internalStep === 1 && selfieData && (jsx(SelfieConfirmation, { selfieData: selfieData, onConfirm: handleConfirmSelfie, onRetake: handleRetakeSelfie, setSelfiePhoto: setSelfiePhoto })), internalStep === 2 && selfieData && (jsx(SelfieProcessing, { onProcessingComplete: selfieProcessed, selfieVideo: selfieData, selfiePhoto: selfiePhoto, onRetake: onRetake, nodeId: node.id, onContinueAnyway: node.allowContinueOnFailure === false
48
+ return (jsxs("div", { className: "h-full w-full transition-opacity duration-500 ".concat(isTransitioning ? "opacity-50" : "opacity-100"), children: [internalStep === 0 && (jsx(Video, { setSelfieData: setSelfieData, setStep: setInternalStep, sessionId: sessionId, iad: node.iad, btnBg: (_b = template.buttonBgColor) !== null && _b !== void 0 ? _b : "#11E5C5", btnText: (_c = template.buttonTextColor) !== null && _c !== void 0 ? _c : "#3C3C40" })), internalStep === 1 && selfieData && (jsx(SelfieConfirmation, { selfieData: selfieData, onConfirm: handleConfirmSelfie, onRetake: handleRetakeSelfie, setSelfiePhoto: setSelfiePhoto })), internalStep === 2 && selfieData && (jsx(SelfieProcessing, { onProcessingComplete: selfieProcessed, selfieVideo: selfieData, selfiePhoto: selfiePhoto, onRetake: onRetake, nodeId: node.id, onContinueAnyway: node.allowContinueOnFailure === false
49
49
  ? undefined
50
50
  : handleContinueAnyway }))] }));
51
51
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Selfie.js","sources":["../../../../../src/components/session/Selfie.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport {\n SessionTemplate,\n SessionTemplateNode,\n stepObject,\n} from \"../../types/session\";\nimport Video from \"../selfie/Video\";\nimport SelfieConfirmation from \"../selfie/SelfieConfirmation\";\nimport type { SelfieCaptureData } from \"../../types/selfie\";\nimport SelfieProcessing from \"../selfie/selfie-flow/SelfieProcessing\";\nimport { reportSelfieFailure } from \"../../services/sessionService\";\n\n/**\n * Composant de gestion du flux selfie.\n * Gère les étapes internes de capture et confirmation du selfie.\n */\nconst Selfie = ({\n stepObject,\n sessionId,\n node,\n template,\n}: {\n stepObject: stepObject;\n sessionId: string;\n node: SessionTemplateNode;\n template: SessionTemplate;\n}) => {\n const [internalStep, setInternalStep] = useState(0);\n const [selfieData, setSelfieData] = useState<SelfieCaptureData | null>(null);\n const [selfiePhoto, setSelfiePhoto] = useState<string | null>(null);\n const [isTransitioning, setIsTransitioning] = useState(false);\n\n const handleConfirmSelfie = () => {\n // Ajouter une transition visuelle avant de passer à l'étape suivante\n setIsTransitioning(true);\n\n // Attendre un peu pour l'animation avant de passer à l'étape suivante\n setTimeout(() => {\n setInternalStep(2); // Passer à l'étape de traitement du selfie\n setIsTransitioning(false);\n }, 500);\n };\n\n const selfieProcessed = (processed: boolean) => {\n // Callback pour indiquer que le selfie a été traité\n if (processed) {\n stepObject.goToNextStepCommitted(node.id, template);\n }\n };\n\n const handleContinueAnyway = () => {\n void reportSelfieFailure(sessionId, {\n nodeId: node.id,\n reason: \"user_bypassed\",\n bypassed: true,\n }).catch(() => undefined);\n stepObject.goToNextStepCommitted(node.id, template);\n };\n\n const onRetake = () => {\n setInternalStep(0);\n };\n\n const handleRetakeSelfie = () => {\n setInternalStep(0);\n };\n\n return (\n <div\n className={`h-full w-full transition-opacity duration-500 ${isTransitioning ? \"opacity-50\" : \"opacity-100\"\n }`}\n >\n {internalStep === 0 && (\n <Video\n setSelfieData={setSelfieData}\n setStep={setInternalStep}\n btnBg={template.buttonBgColor ?? \"#11E5C5\"}\n btnText={template.buttonTextColor ?? \"#3C3C40\"}\n />\n )}\n {internalStep === 1 && selfieData && (\n <SelfieConfirmation\n selfieData={selfieData}\n onConfirm={handleConfirmSelfie}\n onRetake={handleRetakeSelfie}\n setSelfiePhoto={setSelfiePhoto}\n />\n )}\n {internalStep === 2 && selfieData && (\n <SelfieProcessing\n onProcessingComplete={selfieProcessed}\n selfieVideo={selfieData}\n selfiePhoto={selfiePhoto}\n onRetake={onRetake}\n nodeId={node.id}\n onContinueAnyway={\n node.allowContinueOnFailure === false\n ? undefined\n : handleContinueAnyway\n }\n />\n )}\n </div>\n );\n};\n\nexport default Selfie;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;AAYA;;;AAGG;AACH,IAAM,MAAM,GAAG,UAAC,EAUf,EAAA;;QATC,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,IAAI,GAAA,EAAA,CAAA,IAAA,EACJ,QAAQ,GAAA,EAAA,CAAA,QAAA;IAOF,IAAA,EAAA,GAAkC,QAAQ,CAAC,CAAC,CAAC,EAA5C,YAAY,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,eAAe,GAAA,EAAA,CAAA,CAAA,CAAe;IAC7C,IAAA,EAAA,GAA8B,QAAQ,CAA2B,IAAI,CAAC,EAArE,UAAU,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,aAAa,GAAA,EAAA,CAAA,CAAA,CAA4C;IACtE,IAAA,EAA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AiD,eAAe,GAAG,YAAY,GAAG,aAAa,CACtG,EAAA,QAAA,EAAA,CAEH,YAAY,KAAK,CAAC,KACjBC,GAAA,CAAC,KAAK,EAAA,EACJ,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,CAAA,EAAA,GAAA,QAAQ,CAAC,aAAa,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAI,SAAS,EAC1C,OAAO,EAAE,CAAA,EAAA,GAAA,QAAQ,CAAC,eAAe,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAI,SAAS,EAAA,CAC9C,CACH,EACA,YAAY,KAAK,CAAC,IAAI,UAAU,KAC/BA,IAAC,kBAAkB,EAAA,EACjB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,mBAAmB,EAC9B,QAAQ,EAAE,kBAAkB,EAC5B,cAAc,EAAE,cAAc,EAAA,CAC9B,CACH,EACA,YAAY,KAAK,CAAC,IAAI,UAAU,KAC/BA,GAAA,CAAC,gBAAgB,IACf,oBAAoB,EAAE,eAAe,EACrC,WAAW,EAAE,UAAU,EACvB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,IAAI,CAAC,EAAE,EACf,gBAAgB,EACd,IAAI,CAAC,sBAAsB,KAAK;AAC9B,sBAAE;AACF,sBAAE,oBAAoB,EAAA,CAE1B,CACH,CAAA,EAAA,CACG;AAEV;;;;"}
1
+ {"version":3,"file":"Selfie.js","sources":["../../../../../src/components/session/Selfie.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport {\n SessionTemplate,\n SessionTemplateNode,\n stepObject,\n} from \"../../types/session\";\nimport Video from \"../selfie/Video\";\nimport SelfieConfirmation from \"../selfie/SelfieConfirmation\";\nimport type { SelfieCaptureData } from \"../../types/selfie\";\nimport SelfieProcessing from \"../selfie/selfie-flow/SelfieProcessing\";\nimport { reportSelfieFailure } from \"../../services/sessionService\";\n\n/**\n * Composant de gestion du flux selfie.\n * Gère les étapes internes de capture et confirmation du selfie.\n */\nconst Selfie = ({\n stepObject,\n sessionId,\n node,\n template,\n}: {\n stepObject: stepObject;\n sessionId: string;\n node: SessionTemplateNode;\n template: SessionTemplate;\n}) => {\n const [internalStep, setInternalStep] = useState(0);\n const [selfieData, setSelfieData] = useState<SelfieCaptureData | null>(null);\n const [selfiePhoto, setSelfiePhoto] = useState<string | null>(null);\n const [isTransitioning, setIsTransitioning] = useState(false);\n\n const handleConfirmSelfie = () => {\n // Ajouter une transition visuelle avant de passer à l'étape suivante\n setIsTransitioning(true);\n\n // Attendre un peu pour l'animation avant de passer à l'étape suivante\n setTimeout(() => {\n setInternalStep(2); // Passer à l'étape de traitement du selfie\n setIsTransitioning(false);\n }, 500);\n };\n\n const selfieProcessed = (processed: boolean) => {\n // Callback pour indiquer que le selfie a été traité\n if (processed) {\n stepObject.goToNextStepCommitted(node.id, template);\n }\n };\n\n const handleContinueAnyway = () => {\n void reportSelfieFailure(sessionId, {\n nodeId: node.id,\n reason: \"user_bypassed\",\n bypassed: true,\n }).catch(() => undefined);\n stepObject.goToNextStepCommitted(node.id, template);\n };\n\n const onRetake = () => {\n setInternalStep(0);\n };\n\n const handleRetakeSelfie = () => {\n setInternalStep(0);\n };\n\n return (\n <div\n className={`h-full w-full transition-opacity duration-500 ${isTransitioning ? \"opacity-50\" : \"opacity-100\"\n }`}\n >\n {internalStep === 0 && (\n <Video\n setSelfieData={setSelfieData}\n setStep={setInternalStep}\n sessionId={sessionId}\n iad={node.iad}\n btnBg={template.buttonBgColor ?? \"#11E5C5\"}\n btnText={template.buttonTextColor ?? \"#3C3C40\"}\n />\n )}\n {internalStep === 1 && selfieData && (\n <SelfieConfirmation\n selfieData={selfieData}\n onConfirm={handleConfirmSelfie}\n onRetake={handleRetakeSelfie}\n setSelfiePhoto={setSelfiePhoto}\n />\n )}\n {internalStep === 2 && selfieData && (\n <SelfieProcessing\n onProcessingComplete={selfieProcessed}\n selfieVideo={selfieData}\n selfiePhoto={selfiePhoto}\n onRetake={onRetake}\n nodeId={node.id}\n onContinueAnyway={\n node.allowContinueOnFailure === false\n ? undefined\n : handleContinueAnyway\n }\n />\n )}\n </div>\n );\n};\n\nexport default Selfie;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;AAYA;;;AAGG;AACH,IAAM,MAAM,GAAG,UAAC,EAUf,EAAA;;QATC,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,IAAI,GAAA,EAAA,CAAA,IAAA,EACJ,QAAQ,GAAA,EAAA,CAAA,QAAA;IAOF,IAAA,EAAA,GAAkC,QAAQ,CAAC,CAAC,CAAC,EAA5C,YAAY,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,eAAe,GAAA,EAAA,CAAA,CAAA,CAAe;IAC7C,IAAA,EAAA,GAA8B,QAAQ,CAA2B,IAAI,CAAC,EAArE,UAAU,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,aAAa,GAAA,EAAA,CAAA,CAAA,CAA4C;IACtE,IAAA,EAAA,GAAgC,QAAQ,CAAgB,IAAI,CAAC,EAA5D,WAAW,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,cAAc,GAAA,EAAA,CAAA,CAAA,CAAiC;IAC7D,IAAA,EAAA,GAAwC,QAAQ,CAAC,KAAK,CAAC,EAAtD,eAAe,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,kBAAkB,GAAA,EAAA,CAAA,CAAA,CAAmB;AAE7D,IAAA,IAAM,mBAAmB,GAAG,YAAA;;QAE1B,kBAAkB,CAAC,IAAI,CAAC;;AAGxB,QAAA,UAAU,CAAC,YAAA;AACT,YAAA,eAAe,CAAC,CAAC,CAAC,CAAC;YACnB,kBAAkB,CAAC,KAAK,CAAC;QAC3B,CAAC,EAAE,GAAG,CAAC;AACT,IAAA,CAAC;IAED,IAAM,eAAe,GAAG,UAAC,SAAkB,EAAA;;QAE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kB,EAAA,EACjB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,mBAAmB,EAC9B,QAAQ,EAAE,kBAAkB,EAC5B,cAAc,EAAE,cAAc,EAAA,CAC9B,CACH,EACA,YAAY,KAAK,CAAC,IAAI,UAAU,KAC/BA,GAAA,CAAC,gBAAgB,EAAA,EACf,oBAAoB,EAAE,eAAe,EACrC,WAAW,EAAE,UAAU,EACvB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,IAAI,CAAC,EAAE,EACf,gBAAgB,EACd,IAAI,CAAC,sBAAsB,KAAK;AAC9B,sBAAE;AACF,sBAAE,oBAAoB,EAAA,CAE1B,CACH,CAAA,EAAA,CACG;AAEV;;;;"}
@@ -129,7 +129,8 @@ var user_guidance = {
129
129
  "2.2": "The photo is not clear. Avoid any blur or reflection",
130
130
  "2.4": "The photo is not clear. Avoid any blur or reflection",
131
131
  "2.6": "The document submitted is not the expected one",
132
- QUOTA_EXCEEDED: "Your organisation has reached its verification quota. Please try again later or contact the organisation that sent you this link."
132
+ QUOTA_EXCEEDED: "Your organisation has reached its verification quota. Please try again later or contact the organisation that sent you this link.",
133
+ INSUFFICIENT_CREDITS: "The organisation that sent you this link has run out of verification credits. Please contact them to complete your verification."
133
134
  };
134
135
  var validation_points = {
135
136
  "1.0": {
@@ -267,6 +268,7 @@ var errors = {
267
268
  verification_failed_subtitle_no_retry: "We could not validate your {{documentType}}. Please check the points below.",
268
269
  problems_detected: "Problems Detected",
269
270
  improvement_tips: "Improvement Tips",
271
+ service_refusal_title: "Verification temporarily unavailable",
270
272
  image_quality_insufficient: "• Image quality: Insufficient",
271
273
  readability_problematic: "• Information readability: Problematic",
272
274
  authenticity_not_verified: "• Authenticity: Not verified",
@@ -1 +1 @@
1
- {"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -129,7 +129,8 @@ var user_guidance = {
129
129
  "2.2": "La foto no es clara. Evita desenfoques y reflejos",
130
130
  "2.4": "La foto no es clara. Evita desenfoques y reflejos",
131
131
  "2.6": "El documento enviado no es el esperado",
132
- QUOTA_EXCEEDED: "Su organización ha alcanzado su cuota de verificaciones. Inténtelo de nuevo más tarde o póngase en contacto con la organización que le envió este enlace."
132
+ QUOTA_EXCEEDED: "Su organización ha alcanzado su cuota de verificaciones. Inténtelo de nuevo más tarde o póngase en contacto con la organización que le envió este enlace.",
133
+ INSUFFICIENT_CREDITS: "La organización que le envió este enlace no tiene más créditos de verificación. Póngase en contacto con ella para completar su trámite."
133
134
  };
134
135
  var validation_points = {
135
136
  "1.0": {
@@ -267,6 +268,7 @@ var errors = {
267
268
  verification_failed_subtitle_no_retry: "No hemos podido validar tu {{documentType}}. Revisa los puntos siguientes.",
268
269
  problems_detected: "Problemas detectados",
269
270
  improvement_tips: "Consejos de mejora",
271
+ service_refusal_title: "Verificación temporalmente no disponible",
270
272
  image_quality_insufficient: "• Calidad de imagen: insuficiente",
271
273
  readability_problematic: "• Legibilidad de la información: problemática",
272
274
  authenticity_not_verified: "• Autenticidad: no verificada",
@@ -1 +1 @@
1
- {"version":3,"file":"es.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -129,7 +129,8 @@ var user_guidance = {
129
129
  "2.2": "La photo n'est pas nette. Évitez tout flou ou reflet",
130
130
  "2.4": "La photo n'est pas nette. Évitez tout flou ou reflet",
131
131
  "2.6": "Le document déposé n'est pas celui attendu",
132
- QUOTA_EXCEEDED: "Le quota de vérifications de votre organisation est atteint. Veuillez réessayer plus tard ou contacter l'organisation qui vous a envoyé ce lien."
132
+ QUOTA_EXCEEDED: "Le quota de vérifications de votre organisation est atteint. Veuillez réessayer plus tard ou contacter l'organisation qui vous a envoyé ce lien.",
133
+ INSUFFICIENT_CREDITS: "L'organisation qui vous a envoyé ce lien n'a plus de crédits de vérification. Veuillez la contacter pour finaliser votre démarche."
133
134
  };
134
135
  var validation_points = {
135
136
  "1.0": {
@@ -267,6 +268,7 @@ var errors = {
267
268
  verification_failed_subtitle_no_retry: "Nous n'avons pas pu valider votre {{documentType}}. Veuillez vérifier les points ci-dessous.",
268
269
  problems_detected: "Problèmes détectés",
269
270
  improvement_tips: "Conseils d'amélioration",
271
+ service_refusal_title: "Vérification momentanément impossible",
270
272
  image_quality_insufficient: "• Qualité des images : Insuffisante",
271
273
  readability_problematic: "• Lisibilité des informations : Problématique",
272
274
  authenticity_not_verified: "• Authenticité : Non vérifiée",
@@ -1 +1 @@
1
- {"version":3,"file":"fr.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -273,28 +273,30 @@ function analyzeFiles(sessionId_1, nodeId_1, files_1, documentTypeId_1) {
273
273
  }
274
274
  function analyzeSelfie(sessionId, selfieFile, selfiePhoto, nodeId) {
275
275
  return __awaiter(this, void 0, void 0, function () {
276
- var formData, response, unisseyResponse, unisseyData, faceComparison, isHighConfidence, isMatch, isGenuine, analysisResponse, err_1, errorMessage, error_3;
277
- var _a, _b, _c, _d;
278
- return __generator(this, function (_e) {
279
- switch (_e.label) {
276
+ var formData, response, unisseyResponse, unisseyData, faceComparison, faceComparisonDisabled, isHighConfidence, isMatch, isGenuine, analysisResponse, err_1, errorMessage, error_3;
277
+ var _a, _b, _c, _d, _e;
278
+ return __generator(this, function (_f) {
279
+ switch (_f.label) {
280
280
  case 0:
281
281
  console.log("🤳 Starting selfie analysis for session:", sessionId);
282
282
  console.log("� File size:", selfieFile.media.size, "bytes");
283
283
  formData = new FormData();
284
284
  formData.append("file", selfieFile.media, "selfie.mp4");
285
285
  formData.append("photo", selfiePhoto);
286
+ if ((_a = selfieFile.metadata) === null || _a === void 0 ? void 0 : _a.trim()) {
287
+ formData.append("selfie-metadata", selfieFile.metadata);
288
+ }
286
289
  if (nodeId)
287
290
  formData.append("nodeId", nodeId);
288
- _e.label = 1;
291
+ _f.label = 1;
289
292
  case 1:
290
- _e.trys.push([1, 13, , 14]);
293
+ _f.trys.push([1, 13, , 14]);
291
294
  console.log("🚀 Sending selfie to UNISSEY API...");
292
295
  return [4 /*yield*/, apiService.post("/session/unissey/".concat(sessionId, "/analyze"), formData, {
293
296
  timeout: SELFIE_ANALYSIS_TIMEOUT,
294
297
  })];
295
298
  case 2:
296
- response = _e.sent();
297
- console.log("✅ Analysis response:", response);
299
+ response = _f.sent();
298
300
  if (!(response.success && response.data)) return [3 /*break*/, 12];
299
301
  console.log("🎉 Unissey analysis completed - checking results...");
300
302
  unisseyResponse = response.data;
@@ -303,40 +305,52 @@ function analyzeSelfie(sessionId, selfieFile, selfiePhoto, nodeId) {
303
305
  unisseyResponse.message === "ok"))) return [3 /*break*/, 11];
304
306
  console.log("✅ Unissey returned success status");
305
307
  unisseyData = unisseyResponse.data;
306
- faceComparison = (_a = unisseyData.details) === null || _a === void 0 ? void 0 : _a.face_comparison;
308
+ faceComparison = (_b = unisseyData.details) === null || _b === void 0 ? void 0 : _b.face_comparison;
309
+ faceComparisonDisabled = unisseyData.face_comparison_disabled === true;
307
310
  isHighConfidence = (faceComparison === null || faceComparison === void 0 ? void 0 : faceComparison.confidence_level) === "high";
308
- isMatch = unisseyData.is_match && (faceComparison === null || faceComparison === void 0 ? void 0 : faceComparison.result) === "match";
309
- isGenuine = isHighConfidence && isMatch;
310
- _e.label = 3;
311
+ isMatch = !faceComparisonDisabled &&
312
+ unisseyData.is_match && (faceComparison === null || faceComparison === void 0 ? void 0 : faceComparison.result) === "match";
313
+ isGenuine = faceComparisonDisabled
314
+ ? unisseyData.is_genuine !== false
315
+ : isHighConfidence && isMatch;
316
+ _f.label = 3;
311
317
  case 3:
312
- _e.trys.push([3, 9, , 10]);
318
+ _f.trys.push([3, 9, , 10]);
313
319
  return [4 /*yield*/, apiService.get("/session/sdk/".concat(sessionId))];
314
320
  case 4:
315
- analysisResponse = _e.sent();
321
+ analysisResponse = _f.sent();
316
322
  if (!(analysisResponse.data && analysisResponse.data.analysisId)) return [3 /*break*/, 8];
317
323
  return [4 /*yield*/, logSelfieCaptured(sessionId, analysisResponse.data.clientInfoId || undefined)];
318
324
  case 5:
319
- _e.sent();
325
+ _f.sent();
320
326
  // Log AI control with selfie analysis results
321
327
  return [4 /*yield*/, logAiControlled(sessionId, {
322
328
  selfieAnalysisResult: isGenuine ? "genuine" : "not_genuine",
323
- isMatch: isMatch ? "match" : "no_match",
329
+ isMatch: faceComparisonDisabled
330
+ ? "not_performed"
331
+ : isMatch
332
+ ? "match"
333
+ : "no_match",
324
334
  confidenceLevel: (faceComparison === null || faceComparison === void 0 ? void 0 : faceComparison.confidence_level) || "unknown",
325
335
  }, analysisResponse.data.clientInfoId || undefined)];
326
336
  case 6:
327
337
  // Log AI control with selfie analysis results
328
- _e.sent();
338
+ _f.sent();
329
339
  return [4 /*yield*/, logStatusModified(sessionId, {
330
340
  selfieAnalysisResult: isGenuine ? "genuine" : "not_genuine",
331
- isMatch: isMatch ? "match" : "no_match",
341
+ isMatch: faceComparisonDisabled
342
+ ? "not_performed"
343
+ : isMatch
344
+ ? "match"
345
+ : "no_match",
332
346
  confidenceLevel: (faceComparison === null || faceComparison === void 0 ? void 0 : faceComparison.confidence_level) || "unknown",
333
347
  }, analysisResponse.data.clientInfoId || undefined)];
334
348
  case 7:
335
- _e.sent();
336
- _e.label = 8;
349
+ _f.sent();
350
+ _f.label = 8;
337
351
  case 8: return [3 /*break*/, 10];
338
352
  case 9:
339
- err_1 = _e.sent();
353
+ err_1 = _f.sent();
340
354
  console.error("Failed to log selfie capture in audit trail:", err_1);
341
355
  return [3 /*break*/, 10];
342
356
  case 10:
@@ -349,14 +363,14 @@ function analyzeSelfie(sessionId, selfieFile, selfiePhoto, nodeId) {
349
363
  console.error("❌ Unissey returned error status:", unisseyResponse.status, unisseyResponse.message);
350
364
  throw new Error("Unissey analysis failed: ".concat(unisseyResponse.message || "Unknown Unissey error"));
351
365
  case 12:
352
- errorMessage = ((_b = response.data) === null || _b === void 0 ? void 0 : _b.message) || response.data || "Unknown error";
366
+ errorMessage = ((_c = response.data) === null || _c === void 0 ? void 0 : _c.message) || response.data || "Unknown error";
353
367
  console.error("❌ API call failed:", errorMessage);
354
368
  throw new Error("Face comparison analysis failed: ".concat(errorMessage));
355
369
  case 13:
356
- error_3 = _e.sent();
370
+ error_3 = _f.sent();
357
371
  console.error("💥 Analysis error:", error_3);
358
372
  // Améliorer le message d'erreur pour l'UI
359
- if ((_d = (_c = error_3.response) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.message) {
373
+ if ((_e = (_d = error_3.response) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.message) {
360
374
  throw new Error("Analysis failed: ".concat(error_3.response.data.message));
361
375
  }
362
376
  else if (error_3.message) {
@@ -370,7 +384,7 @@ function analyzeSelfie(sessionId, selfieFile, selfiePhoto, nodeId) {
370
384
  });
371
385
  });
372
386
  }
373
- function uploadConvertedIdCardImage(sessionId, file) {
387
+ function uploadConvertedIdCardImage(sessionId, file, nodeId) {
374
388
  return __awaiter(this, void 0, void 0, function () {
375
389
  var renamedFile, formData, response, error_4;
376
390
  return __generator(this, function (_a) {
@@ -388,7 +402,7 @@ function uploadConvertedIdCardImage(sessionId, file) {
388
402
  case 1:
389
403
  _a.trys.push([1, 3, , 4]);
390
404
  console.log("\uD83D\uDE80 Uploading converted ID card image for session: ".concat(sessionId));
391
- return [4 /*yield*/, apiService.post("/session/sdk/".concat(sessionId, "/converted_id_card.png"), formData, {
405
+ return [4 /*yield*/, apiService.post("/session/sdk/".concat(sessionId, "/converted_id_card.png").concat(nodeId ? "?nodeId=".concat(encodeURIComponent(nodeId)) : ''), formData, {
392
406
  timeout: UPLOAD_TIMEOUT,
393
407
  })];
394
408
  case 2: