datakeen-session-react 1.1.182 → 1.1.184
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/DatakeenSession.js +3 -1
- package/dist/cjs/components/DatakeenSession.js.map +1 -1
- 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/document-video/document-video-flow/DocumentVideoRecorder.js +6 -1
- package/dist/cjs/components/document-video/document-video-flow/DocumentVideoRecorder.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/selfie/selfie-flow/SelfieRecorder.js +10 -2
- package/dist/cjs/components/selfie/selfie-flow/SelfieRecorder.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/DatakeenSession.js +3 -1
- package/dist/esm/components/DatakeenSession.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/document-video/document-video-flow/DocumentVideoRecorder.js +6 -1
- package/dist/esm/components/document-video/document-video-flow/DocumentVideoRecorder.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/selfie/selfie-flow/SelfieRecorder.js +10 -2
- package/dist/esm/components/selfie/selfie-flow/SelfieRecorder.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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Video.js","sources":["../../../../../src/components/selfie/Video.tsx"],"sourcesContent":["import { useEffect } from \"react\";\nimport type { SelfieCaptureData } from \"../../types/selfie\";\nimport \"./Video.css\";\nimport \"./VideoFixes.css\";\nimport SelfieFlow from \"./selfie-flow/SelfieFlow\";\nimport VideoResetStyles from \"./VideoResetStyles\";\n\ninterface VideoProps {\n setSelfieData: (selfieData: SelfieCaptureData) => void;\n setStep: (step: number) => void;\n
|
|
1
|
+
{"version":3,"file":"Video.js","sources":["../../../../../src/components/selfie/Video.tsx"],"sourcesContent":["import { useEffect } from \"react\";\nimport type { SelfieCaptureData } from \"../../types/selfie\";\nimport \"./Video.css\";\nimport \"./VideoFixes.css\";\nimport SelfieFlow from \"./selfie-flow/SelfieFlow\";\nimport VideoResetStyles from \"./VideoResetStyles\";\n\ninterface VideoProps {\n setSelfieData: (selfieData: SelfieCaptureData) => void;\n setStep: (step: number) => void;\n btnBg?: string;\n btnText?: string;\n}\n\nconst Video = ({ setSelfieData, setStep, btnBg, btnText }: VideoProps) => {\n // Effet pour ajouter la classe au body lorsque le composant est monté\n useEffect(() => {\n // Empêcher le scroll sur le body lorsque la capture est active\n document.body.classList.add(\"selfie-active\");\n\n // Ajouter une classe pour gérer le plein écran sur mobile\n document.documentElement.classList.add(\"selfie-fullscreen\");\n\n return () => {\n // Nettoyer en enlevant les classes lors du démontage\n document.body.classList.remove(\"selfie-active\");\n document.documentElement.classList.remove(\"selfie-fullscreen\");\n };\n }, []);\n\n const handleSelfie = (e: Event) => {\n const data = (e as CustomEvent<SelfieCaptureData>).detail;\n\n // Attendre un court instant avant de passer à l'écran de confirmation\n // pour donner le temps à l'utilisateur de voir que la capture est terminée\n setTimeout(() => {\n setSelfieData(data);\n setStep(1); // Move to the next step after selfie capture\n }, 300);\n };\n\n return (\n <div className=\"w-full h-full overflow-hidden flex flex-col\">\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@ import LoadingState from '../../states/LoadingState.js';
|
|
|
7
7
|
var SelfieRecorder = lazy(function () { return import('./SelfieRecorder.js'); });
|
|
8
8
|
var SelfieFlow = function (_a) {
|
|
9
9
|
var _b;
|
|
10
|
-
var handleSelfie = _a.handleSelfie,
|
|
10
|
+
var handleSelfie = _a.handleSelfie, btnBg = _a.btnBg, btnText = _a.btnText;
|
|
11
11
|
var _c = useState(-1), internalStep = _c[0], setInternalStep = _c[1]; // Commencer à -1 pour la pré-introduction
|
|
12
|
-
var handleBack = function () {
|
|
13
|
-
if (internalStep > -1) {
|
|
14
|
-
setInternalStep(internalStep - 1);
|
|
15
|
-
}
|
|
16
|
-
else if (internalStep === -1 && onBack) {
|
|
17
|
-
// Si on est à la première étape et qu'on a une fonction de retour parent, l'utiliser
|
|
18
|
-
onBack();
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
12
|
return (jsxs("div", { className: "h-full w-full flex flex-col", style: (_b = {},
|
|
22
13
|
_b["--dk-btn-bg"] = btnBg !== null && btnBg !== void 0 ? btnBg : "#11E5C5",
|
|
23
14
|
_b["--dk-btn-text"] = btnText !== null && btnText !== void 0 ? btnText : "#3C3C40",
|
|
24
|
-
_b), children: [internalStep === -1 && (jsx("div", { className: "flex-1 flex flex-col h-full", children: jsx(SelfiePreIntroduction, { onContinue: function () { return setInternalStep(0); }
|
|
15
|
+
_b), children: [internalStep === -1 && (jsx("div", { className: "flex-1 flex flex-col h-full", children: jsx(SelfiePreIntroduction, { onContinue: function () { return setInternalStep(0); } }) })), internalStep === 0 && (jsx("div", { className: "flex-1 flex flex-col h-full", children: jsx(InstructionsSelfie, { setStep: setInternalStep, onBack: function () { return setInternalStep(-1); } }) })), internalStep === 1 && (jsx("div", { className: "flex-1 flex flex-col h-full overflow-hidden", children: jsx(Suspense, { fallback: jsx(LoadingState, {}), children: jsx(SelfieRecorder, { handleSelfie: handleSelfie, btnBg: btnBg, btnText: btnText }) }) }))] }));
|
|
25
16
|
};
|
|
26
17
|
|
|
27
18
|
export { SelfieFlow as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelfieFlow.js","sources":["../../../../../../src/components/selfie/selfie-flow/SelfieFlow.tsx"],"sourcesContent":["import { lazy, Suspense, useState } from \"react\";\nimport SelfiePreIntroduction from \"./SelfiePreIntroduction\";\nimport InstructionsSelfie from \"./InstructionsSelfie\";\nimport LoadingState from \"../../states/LoadingState\";\n\nconst SelfieRecorder = lazy(() => import(\"./SelfieRecorder\"));\n\ninterface SelfieFlowProps {\n handleSelfie: (e: Event) => void;\n
|
|
1
|
+
{"version":3,"file":"SelfieFlow.js","sources":["../../../../../../src/components/selfie/selfie-flow/SelfieFlow.tsx"],"sourcesContent":["import { lazy, Suspense, useState } from \"react\";\nimport SelfiePreIntroduction from \"./SelfiePreIntroduction\";\nimport InstructionsSelfie from \"./InstructionsSelfie\";\nimport LoadingState from \"../../states/LoadingState\";\n\nconst SelfieRecorder = lazy(() => import(\"./SelfieRecorder\"));\n\ninterface SelfieFlowProps {\n handleSelfie: (e: Event) => void;\n btnBg?: string;\n btnText?: string;\n}\n\nconst SelfieFlow = ({ handleSelfie, btnBg, btnText }: SelfieFlowProps) => {\n const [internalStep, setInternalStep] = useState(-1); // Commencer à -1 pour la pré-introduction\n\n return (\n <div\n className=\"h-full w-full flex flex-col\"\n style={{\n [\"--dk-btn-bg\" as string]: btnBg ?? \"#11E5C5\",\n [\"--dk-btn-text\" as string]: btnText ?? \"#3C3C40\",\n }}\n >\n {internalStep === -1 && (\n <div className=\"flex-1 flex flex-col h-full\">\n <SelfiePreIntroduction\n onContinue={() => setInternalStep(0)}\n />\n </div>\n )}\n {internalStep === 0 && (\n <div className=\"flex-1 flex flex-col h-full\">\n <InstructionsSelfie\n setStep={setInternalStep}\n onBack={() => setInternalStep(-1)}\n />\n </div>\n )}\n {internalStep === 1 && (\n <div className=\"flex-1 flex flex-col h-full overflow-hidden\">\n <Suspense fallback={<LoadingState />}>\n <SelfieRecorder handleSel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C,EAAE,CAAC,CAAA,CAAnB,CAAmB,GACjC,EAAA,CACE,CACP,EACA,YAAY,KAAK,CAAC,KACjBA,aAAK,SAAS,EAAC,6CAA6C,EAAA,QAAA,EAC1DA,GAAA,CAAC,QAAQ,EAAA,EAAC,QAAQ,EAAEA,IAAC,YAAY,EAAA,EAAA,CAAG,YAClCA,GAAA,CAAC,cAAc,IAAC,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAA,CAAI,GACrE,EAAA,CACP,CACP,CAAA,EAAA,CACG;AAEV;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelfiePreIntroduction.js","sources":["../../../../../../src/components/selfie/selfie-flow/SelfiePreIntroduction.tsx"],"sourcesContent":["import Title from \"../../ui/Title\";\nimport Subtitle from \"../../ui/Subtitle\";\nimport Button from \"../../ui/Button\";\nimport PageActions from \"../../ui/PageActions\";\nimport { SelfieIcon } from \"../../../assets\";\nimport MobilePageLayout from \"../../ui/MobilePageLayout\";\nimport { useI18n } from \"../../../hooks/useI18n\";\n\ninterface SelfiePreIntroductionProps {\n onContinue: () => void;\n
|
|
1
|
+
{"version":3,"file":"SelfiePreIntroduction.js","sources":["../../../../../../src/components/selfie/selfie-flow/SelfiePreIntroduction.tsx"],"sourcesContent":["import Title from \"../../ui/Title\";\nimport Subtitle from \"../../ui/Subtitle\";\nimport Button from \"../../ui/Button\";\nimport PageActions from \"../../ui/PageActions\";\nimport { SelfieIcon } from \"../../../assets\";\nimport MobilePageLayout from \"../../ui/MobilePageLayout\";\nimport { useI18n } from \"../../../hooks/useI18n\";\n\ninterface SelfiePreIntroductionProps {\n onContinue: () => void;\n}\n\nconst SelfiePreIntroduction = ({ onContinue }: SelfiePreIntroductionProps) => {\n const { t } = useI18n();\n return (\n <MobilePageLayout\n footer={\n <PageActions\n primary={\n <Button onClick={onContinue}>\n {t(\"selfie.pre_intro.start\", \"Commencer\")}\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 \">\n {/* Header */}\n <div className=\"text-center space-y-4\">\n <Title className=\"text-xl md:text-2xl lg:text-3xl font-semibold\">\n {t(\"selfie.pre_intro.title\", \"Prenez une photo de votre visage\")}\n </Title>\n <Subtitle className=\"text-xs md:text-xs text-gray-600 leading-relaxed px-4\">\n {t(\n \"selfie.pre_intro.subtitle\",\n \"Afin de vérifier votre identité, nous allons vous demander de prendre une photo de votre visage\"\n )}\n </Subtitle>\n </div>\n\n {/* Icon */}\n <div className=\"flex justify-center\">\n <div className=\"flex items-center justify-center\">\n <img\n src={SelfieIcon}\n alt=\"Vérification par selfie\"\n className=\"w-80 h-80 object-contain bg-white\"\n />\n </div>\n </div>\n {/* <p className=\"text-center text-xs text-gray-600 leading-relaxed \">\n {t(\n \"selfie.pre_intro.note\",\n \"À la prochaine étape, nous vous demanderons de prendre une photo de votre visage.\"\n )}\n </p> */}\n </div>\n </div>\n </MobilePageLayout>\n );\n};\n\nexport default SelfiePreIntroduction;\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;AAYA,IAAM,qBAAqB,GAAG,UAAC,EAA0C,EAAA;AAAxC,IAAA,IAAA,UAAU,GAAA,EAAA,CAAA,UAAA;AACjC,IAAA,IAAA,CAAC,GAAK,OAAO,EAAE,EAAd;IACT,QACEA,IAAC,gBAAgB,EAAA,EACf,MAAM,EACJA,GAAA,CAAC,WAAW,EAAA,EACV,OAAO,EACLA,IAAC,MAAM,EAAA,EAAC,OAAO,EAAE,UAAU,YACxB,CAAC,CAAC,wBAAwB,EAAE,WAAW,CAAC,GAClC,EAAA,CAEX,EAAA,QAAA,EAGJA,aAAK,SAAS,EAAC,iCAAiC,EAAA,QAAA,EAC9CC,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,0BAA0B,EAAA,QAAA,EAAA,CAEvCA,cAAK,SAAS,EAAC,uBAAuB,EAAA,QAAA,EAAA,CACpCD,GAAA,CAAC,KAAK,IAAC,SAAS,EAAC,+CAA+C,EAAA,QAAA,EAC7D,CAAC,CAAC,wBAAwB,EAAE,kCAAkC,CAAC,EAAA,CAC1D,EACRA,IAAC,QAAQ,EAAA,EAAC,SAAS,EAAC,uDAAuD,EAAA,QAAA,EACxE,CAAC,CACA,2BAA2B,EAC3B,iGAAiG,CAClG,GACQ,CAAA,EAAA,CACP,EAGNA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,qBAAqB,YAClCA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,kCAAkC,EAAA,QAAA,EAC/CA,aACE,GAAG,EAAE,UAAU,EACf,GAAG,EAAC,8BAAyB,EAC7B,SAAS,EAAC,mCAAmC,EAAA,CAC7C,EAAA,CACE,GACF,CAAA,EAAA,CAOF,EAAA,CACF,EAAA,CACW;AAEvB;;;;"}
|
|
@@ -51,6 +51,14 @@ var SelfieRecorder = function (_a) {
|
|
|
51
51
|
useEffect(function () {
|
|
52
52
|
document.body.classList.add("recording-selfie");
|
|
53
53
|
var cleanupObserver = setupVideoElementsObserver();
|
|
54
|
+
// Les traducteurs automatiques (Safari iOS notamment) réécrivent le DOM et
|
|
55
|
+
// détruisent les marqueurs de template Lit du web component Unissey : la capture
|
|
56
|
+
// ne redémarre alors plus jamais. React sérialise `translate` en propriété DOM sur
|
|
57
|
+
// un custom element (d'où un translate="yes" parasite), il faut poser l'attribut
|
|
58
|
+
// impérativement.
|
|
59
|
+
document
|
|
60
|
+
.querySelectorAll("uni-video-recorder")
|
|
61
|
+
.forEach(function (el) { return el.setAttribute("translate", "no"); });
|
|
54
62
|
// iOS-specific fix: Add required attributes to video elements after mount
|
|
55
63
|
if (isIOS()) {
|
|
56
64
|
var addIOSVideoAttributes = function () {
|
|
@@ -197,7 +205,7 @@ var SelfieRecorder = function (_a) {
|
|
|
197
205
|
updateRecordingState("processing");
|
|
198
206
|
handleSelfie(enhancedEvent);
|
|
199
207
|
};
|
|
200
|
-
return (jsxs("div", { className: "selfie selfie-recorder-root flex flex-col", style: (_b = {},
|
|
208
|
+
return (jsxs("div", { className: "selfie selfie-recorder-root notranslate flex flex-col", translate: "no", style: (_b = {},
|
|
201
209
|
_b["--dk-btn-bg"] = btnBg !== null && btnBg !== void 0 ? btnBg : "#11E5C5",
|
|
202
210
|
_b["--dk-btn-text"] = btnText !== null && btnText !== void 0 ? btnText : "#3C3C40",
|
|
203
211
|
_b.position = isMobile ? "fixed" : "relative",
|
|
@@ -205,7 +213,7 @@ var SelfieRecorder = function (_a) {
|
|
|
205
213
|
_b.zIndex = isMobile ? 50 : "auto",
|
|
206
214
|
_b.height = "100%",
|
|
207
215
|
_b.width = "100%",
|
|
208
|
-
_b), children: [jsxs("div", { className: "p-4 text-center bg-white shrink-0", children: [jsx(Title, { className: "text-lg md:text-xl mb-1", children: t("selfie.recorder.title") }), jsx(Subtitle, { className: "text-xs text-gray-600 md:text-sm", children: t("selfie.recorder.subtitle") })] }), jsx("div", { className: "video-container flex-1 relative overflow-hidden", children: jsx(VideoRecorder, __assign({ ref: recorderRef, preset: AcquisitionPreset.SELFIE_OPTIMIZED, hideCaptureBtn: true, faceChecker: (typeof window !== 'undefined' && window.__E2E_DISABLE_FACE_CHECKER__) ? 'disabled' : 'enabled', disableDebugMode: true, onRecorderReady: handleRecorderReady, onRecordInterrupted: handleRecordInterrupted, onRecordCompleted: handleRecordCompleted, style: { width: "100%", height: "100%" }, className: "video-recorder-no-radius w-full h-full" }, (isIOS() && {
|
|
216
|
+
_b), children: [jsxs("div", { className: "p-4 text-center bg-white shrink-0", children: [jsx(Title, { className: "text-lg md:text-xl mb-1", children: t("selfie.recorder.title") }), jsx(Subtitle, { className: "text-xs text-gray-600 md:text-sm", children: t("selfie.recorder.subtitle") })] }), jsx("div", { className: "video-container flex-1 relative overflow-hidden", children: jsx(VideoRecorder, __assign({ ref: recorderRef, preset: AcquisitionPreset.SELFIE_OPTIMIZED, hideCaptureBtn: true, faceChecker: (typeof window !== 'undefined' && window.__E2E_DISABLE_FACE_CHECKER__) ? 'disabled' : 'enabled', disableDebugMode: true, onRecorderReady: handleRecorderReady, onRecordInterrupted: handleRecordInterrupted, onRecordCompleted: handleRecordCompleted, style: { width: "100%", height: "100%" }, className: "video-recorder-no-radius notranslate w-full h-full" }, (isIOS() && {
|
|
209
217
|
"data-playsinline": "true",
|
|
210
218
|
"data-autoplay": "true",
|
|
211
219
|
"data-muted": "true"
|
|
@@ -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 // 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 flex flex-col\"\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 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 </Button>\n </div>\n </div>\n </div>\n );\n};\n\nexport default SelfieRecorder;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;AA+BA,IAAM,cAAc,GAAG,UAAC,EAKF,EAAA;;AAJpB,IAAA,IAAA,YAAY,GAAA,EAAA,CAAA,YAAA,EACZ,EAAA,GAAA,EAAA,CAAA,cAA0B,EAA1B,cAAc,GA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C5D,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 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 </Button>\n </div>\n </div>\n </div>\n );\n};\n\nexport default SelfieRecorder;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;AA+BA,IAAM,cAAc,GAAG,UAAC,EAKF,EAAA;;AAJpB,IAAA,IAAA,YAAY,GAAA,EAAA,CAAA,YAAA,EACZ,EAAA,GAAA,EAAA,CAAA,cAA0B,EAA1B,cAAc,GAA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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;;;;"}
|
|
@@ -692,7 +692,7 @@ var DocumentCheck = function (_a) {
|
|
|
692
692
|
return stepObject.setStep(Math.max(0, stepObject.step - 1));
|
|
693
693
|
}, children: t("document_check.config_error.back", "Retour") })] }));
|
|
694
694
|
}
|
|
695
|
-
return (jsx(JDIPreIntroduction, { documentTypeId: documentTypeId, onContinue: function () { return setDocStep(1); }, onBack: handleBack, introTitleText: ((_h = node.introductionPage) === null || _h === void 0 ? void 0 : _h.title) || t("jdi.pre_introduction.title"), introDescText: ((_j = node.introductionPage) === null || _j === void 0 ? void 0 : _j.description) ||
|
|
695
|
+
return (jsx(JDIPreIntroduction, { documentTypeId: documentTypeId, onContinue: function () { return setDocStep(1); }, onBack: stepObject.canGoBack ? handleBack : undefined, introTitleText: ((_h = node.introductionPage) === null || _h === void 0 ? void 0 : _h.title) || t("jdi.pre_introduction.title"), introDescText: ((_j = node.introductionPage) === null || _j === void 0 ? void 0 : _j.description) ||
|
|
696
696
|
t("jdi.pre_introduction.description") }));
|
|
697
697
|
case 1:
|
|
698
698
|
return (jsx(JDICountrySelection, { onCountrySelect: handleCountrySelect, onBack: handleBack, documentTypeId: documentTypeId, acceptedCountries: finalAcceptedCountries, countryIntroText: ((_k = node.countrySelection) === null || _k === void 0 ? void 0 : _k.title) || t("jdi.country_selection.title"), countryDescText: ((_l = node.countrySelection) === null || _l === void 0 ? void 0 : _l.description) ||
|