datakeen-session-react 1.1.140-dev.36 → 1.1.140-dev.37

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 (27) hide show
  1. package/dist/cjs/components/selfie/SelfieConfirmation.js +1 -1
  2. package/dist/cjs/components/selfie/SelfieConfirmation.js.map +1 -1
  3. package/dist/cjs/components/selfie/hooks/useVideoRecorderStyles.js +2 -2
  4. package/dist/cjs/components/selfie/hooks/useVideoRecorderStyles.js.map +1 -1
  5. package/dist/cjs/components/selfie/selfie-flow/SelfieFlow.js +6 -2
  6. package/dist/cjs/components/selfie/selfie-flow/SelfieFlow.js.map +1 -1
  7. package/dist/cjs/components/selfie/selfie-flow/SelfieRecorder.js +4 -4
  8. package/dist/cjs/components/selfie/selfie-flow/SelfieRecorder.js.map +1 -1
  9. package/dist/cjs/components/session/Selfie.js +1 -0
  10. package/dist/cjs/components/session/Selfie.js.map +1 -1
  11. package/dist/cjs/components/ui/Button.js +5 -3
  12. package/dist/cjs/components/ui/Button.js.map +1 -1
  13. package/dist/cjs/index.css.js +1 -1
  14. package/dist/esm/components/selfie/SelfieConfirmation.js +1 -1
  15. package/dist/esm/components/selfie/SelfieConfirmation.js.map +1 -1
  16. package/dist/esm/components/selfie/hooks/useVideoRecorderStyles.js +2 -2
  17. package/dist/esm/components/selfie/hooks/useVideoRecorderStyles.js.map +1 -1
  18. package/dist/esm/components/selfie/selfie-flow/SelfieFlow.js +6 -2
  19. package/dist/esm/components/selfie/selfie-flow/SelfieFlow.js.map +1 -1
  20. package/dist/esm/components/selfie/selfie-flow/SelfieRecorder.js +4 -4
  21. package/dist/esm/components/selfie/selfie-flow/SelfieRecorder.js.map +1 -1
  22. package/dist/esm/components/session/Selfie.js +1 -0
  23. package/dist/esm/components/session/Selfie.js.map +1 -1
  24. package/dist/esm/components/ui/Button.js +5 -3
  25. package/dist/esm/components/ui/Button.js.map +1 -1
  26. package/dist/esm/index.css.js +1 -1
  27. package/package.json +1 -1
@@ -46,7 +46,7 @@ var SelfieConfirmation = function (_a) {
46
46
  if (!imageUrl) {
47
47
  return (jsxRuntime.jsx("div", { className: "flex flex-col items-center justify-center h-full bg-white", children: jsxRuntime.jsxs("div", { className: "text-center p-6 max-w-md mx-auto", children: [jsxRuntime.jsx("div", { className: "w-16 h-16 mx-auto mb-4 text-yellow-500", children: jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }), jsxRuntime.jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), jsxRuntime.jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })] }) }), jsxRuntime.jsx(Title.default, { className: "text-xl mb-2", children: t("selfie.confirmation.no_display_title", "Impossible d'afficher le selfie") }), jsxRuntime.jsx("p", { className: "mb-6 text-sm text-gray-600", children: t("selfie.confirmation.no_display_desc", "Nous n'avons pas pu traiter correctement votre selfie.") }), jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: onRetake, className: "md:max-w-xs mx-auto", children: t("selfie.confirmation.retake", "Reprendre le selfie") })] }) }));
48
48
  }
49
- return (jsxRuntime.jsx(MobilePageLayout.default, { header: jsxRuntime.jsxs("div", { className: "p-4 text-center bg-white border-b border-gray-100", children: [jsxRuntime.jsx(Title.default, { className: "text-xl md:text-2xl", children: t("selfie.confirmation.title", "Confirmez votre selfie") }), jsxRuntime.jsx(Subtitle.default, { className: "text-xs text-gray-600 mt-2 md:text-sm", children: t("selfie.confirmation.subtitle", "Vérifiez que votre visage est clairement visible") })] }), footer: jsxRuntime.jsx(PageActions.default, { primary: jsxRuntime.jsx(Button.default, { onClick: onConfirm, children: t("selfie.confirmation.confirm", "Confirmer") }), secondary: jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: onRetake, children: t("selfie.confirmation.retake", "Reprendre le selfie") }) }), className: "bg-white", children: jsxRuntime.jsx("div", { className: "px-4 py-6 md:px-8 md:py-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto space-y-6", children: [jsxRuntime.jsx("div", { className: "w-full bg-white rounded-lg overflow-hidden shadow-md", children: jsxRuntime.jsxs("div", { className: "relative rounded-lg overflow-hidden border-2 border-[#11E5C5]", children: [jsxRuntime.jsx("img", { src: imageUrl, alt: "Selfie captur\u00E9", className: "w-full max-h-[50vh] object-contain bg-white", onError: function () {
49
+ return (jsxRuntime.jsx(MobilePageLayout.default, { header: jsxRuntime.jsxs("div", { className: "p-4 text-center bg-white border-b border-gray-100", children: [jsxRuntime.jsx(Title.default, { className: "text-xl md:text-2xl", children: t("selfie.confirmation.title", "Confirmez votre selfie") }), jsxRuntime.jsx(Subtitle.default, { className: "text-xs text-gray-600 mt-2 md:text-sm", children: t("selfie.confirmation.subtitle", "Vérifiez que votre visage est clairement visible") })] }), footer: jsxRuntime.jsx(PageActions.default, { primary: jsxRuntime.jsx(Button.default, { onClick: onConfirm, children: t("selfie.confirmation.confirm", "Confirmer") }), secondary: jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: onRetake, children: t("selfie.confirmation.retake", "Reprendre le selfie") }) }), className: "bg-white", children: jsxRuntime.jsx("div", { className: "px-4 py-6 md:px-8 md:py-8", children: jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-auto space-y-6", children: [jsxRuntime.jsx("div", { className: "w-full bg-white rounded-lg shadow-md", children: jsxRuntime.jsxs("div", { className: "relative rounded-lg border-2 border-[#11E5C5] flex items-center justify-center bg-white", children: [jsxRuntime.jsx("img", { src: imageUrl, alt: "Selfie captur\u00E9", className: "w-full h-auto object-contain rounded-lg", style: { maxHeight: "50vh" }, onError: function () {
50
50
  setError("Impossible d'afficher l'image du selfie");
51
51
  } }), jsxRuntime.jsx("div", { className: "absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/30 to-transparent p-3", children: jsxRuntime.jsx("p", { className: "text-white text-xs text-center", children: t("selfie.confirmation.overlay_success", "Selfie capturé avec succès") }) })] }) }), jsxRuntime.jsxs("div", { className: "bg-gray-50 p-4 rounded-lg", children: [jsxRuntime.jsx("h3", { className: "font-medium text-sm mb-3", children: t("selfie.confirmation.checklist_title", "Vérifiez que :") }), jsxRuntime.jsxs("ul", { className: "space-y-2 text-xs text-gray-700", children: [jsxRuntime.jsxs("li", { className: "flex items-start", children: [jsxRuntime.jsx("svg", { className: "w-4 h-4 text-green-500 mr-2 mt-0.5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M5 13l4 4L19 7" }) }), t("selfie.confirmation.check_visible", "Votre visage est bien visible et occupe la majeure partie de l'image")] }), jsxRuntime.jsxs("li", { className: "flex items-start", children: [jsxRuntime.jsx("svg", { className: "w-4 h-4 text-green-500 mr-2 mt-0.5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M5 13l4 4L19 7" }) }), t("selfie.confirmation.check_well_lit", "L'image est nette et bien éclairée")] }), jsxRuntime.jsxs("li", { className: "flex items-start", children: [jsxRuntime.jsx("svg", { className: "w-4 h-4 text-green-500 mr-2 mt-0.5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M5 13l4 4L19 7" }) }), t("selfie.confirmation.check_no_object", "Aucun objet ne cache votre visage (lunettes de soleil, masque, etc.)")] })] })] }), jsxRuntime.jsx("canvas", { ref: canvasRef, style: { display: "none" } })] }) }) }));
52
52
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SelfieConfirmation.js","sources":["../../../../../src/components/selfie/SelfieConfirmation.tsx"],"sourcesContent":["/**\n * SelfieConfirmation component\n *\n * Displays the captured selfie and allows the user to confirm or retake it.\n *\n * @param {Object} props - Component props\n * @param {SelfieCaptureData} props.selfieData - The captured selfie data containing media blob and metadata\n * @param {Function} props.onConfirm - Function called when user confirms the selfie\n * @param {Function} props.onRetake - Function called when user wants to retake the selfie\n * @returns {JSX.Element} The selfie confirmation UI component\n */\n\nimport { useEffect, useRef, useState } from \"react\";\nimport type { SelfieCaptureData } from \"../../types/selfie\";\nimport Button from \"../ui/Button\";\nimport PageActions from \"../ui/PageActions\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\nimport { useI18n } from \"../../hooks/useI18n\";\n\ninterface SelfieConfirmationProps {\n selfieData: SelfieCaptureData;\n setSelfiePhoto: (photo: string) => void;\n onConfirm: () => void;\n onRetake: () => void;\n}\n\nconst SelfieConfirmation = ({\n selfieData,\n setSelfiePhoto,\n onConfirm,\n onRetake,\n}: SelfieConfirmationProps) => {\n const { t } = useI18n();\n const [isLoading, setIsLoading] = useState(true);\n const [error, setError] = useState<string | null>(null);\n const [imageUrl, setImageUrl] = useState<string | null>(null);\n const canvasRef = useRef<HTMLCanvasElement>(null);\n\n useEffect(() => {\n setIsLoading(true);\n setError(null);\n\n if (!selfieData?.media) {\n setError(t(\"selfie.confirmation.errors.no_data\", \"Aucune donnée de selfie disponible\"));\n setIsLoading(false);\n return;\n }\n\n // Use pre-captured thumbnail from live video stream\n if (selfieData.thumbnail) {\n setImageUrl(selfieData.thumbnail);\n setSelfiePhoto(selfieData.thumbnail);\n setIsLoading(false);\n return;\n }\n\n // No thumbnail available (should not happen)\n setError(t(\"selfie.confirmation.errors.no_preview\", \"Aucune preview disponible\"));\n setIsLoading(false);\n }, [selfieData, setSelfiePhoto]);\n\n if (isLoading) {\n return (\n <div className=\"flex flex-col items-center justify-center h-full bg-white\">\n <div className=\"text-center p-6\">\n <div className=\"mb-4 text-gray-700\">\n {t(\"selfie.confirmation.loading\", \"Traitement de votre selfie...\")}\n </div>\n <div className=\"w-12 h-12 border-4 border-[#11E5C5] border-t-transparent rounded-full animate-spin mx-auto\"></div>\n </div>\n </div>\n );\n }\n\n if (error) {\n return (\n <div className=\"flex flex-col items-center justify-center h-full bg-white\">\n <div className=\"text-center p-6 max-w-md mx-auto\">\n <div className=\"w-16 h-16 mx-auto mb-4 text-red-500\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n <line x1=\"15\" y1=\"9\" x2=\"9\" y2=\"15\"></line>\n <line x1=\"9\" y1=\"9\" x2=\"15\" y2=\"15\"></line>\n </svg>\n </div>\n <Title className=\"text-xl mb-2\">{t(\"selfie.confirmation.error_title\", \"Une erreur est survenue\")}</Title>\n <p className=\"mb-6 text-sm text-gray-600\">{error}</p>\n <Button variant=\"secondary\" onClick={onRetake} className=\"md:max-w-xs mx-auto\">\n {t(\"selfie.confirmation.retake\", \"Reprendre le selfie\")}\n </Button>\n </div>\n </div>\n );\n }\n\n if (!imageUrl) {\n return (\n <div className=\"flex flex-col items-center justify-center h-full bg-white\">\n <div className=\"text-center p-6 max-w-md mx-auto\">\n <div className=\"w-16 h-16 mx-auto mb-4 text-yellow-500\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n <line x1=\"12\" y1=\"8\" x2=\"12\" y2=\"12\"></line>\n <line x1=\"12\" y1=\"16\" x2=\"12.01\" y2=\"16\"></line>\n </svg>\n </div>\n <Title className=\"text-xl mb-2\">{t(\"selfie.confirmation.no_display_title\", \"Impossible d'afficher le selfie\")}</Title>\n <p className=\"mb-6 text-sm text-gray-600\">{t(\"selfie.confirmation.no_display_desc\", \"Nous n'avons pas pu traiter correctement votre selfie.\")}</p>\n <Button variant=\"secondary\" onClick={onRetake} className=\"md:max-w-xs mx-auto\">\n {t(\"selfie.confirmation.retake\", \"Reprendre le selfie\")}\n </Button>\n </div>\n </div>\n );\n }\n\n return (\n <MobilePageLayout\n header={\n <div className=\"p-4 text-center bg-white border-b border-gray-100\">\n <Title className=\"text-xl md:text-2xl\">{t(\"selfie.confirmation.title\", \"Confirmez votre selfie\")}</Title>\n <Subtitle className=\"text-xs text-gray-600 mt-2 md:text-sm\">{t(\"selfie.confirmation.subtitle\", \"Vérifiez que votre visage est clairement visible\")}</Subtitle>\n </div>\n }\n footer={\n <PageActions\n primary={\n <Button onClick={onConfirm}>\n {t(\"selfie.confirmation.confirm\", \"Confirmer\")}\n </Button>\n }\n secondary={\n <Button variant=\"secondary\" onClick={onRetake}>\n {t(\"selfie.confirmation.retake\", \"Reprendre le selfie\")}\n </Button>\n }\n />\n }\n className=\"bg-white\"\n >\n <div className=\"px-4 py-6 md:px-8 md:py-8\">\n <div className=\"w-full max-w-md mx-auto space-y-6\">\n {/* Selfie display with frame */}\n <div className=\"w-full bg-white rounded-lg overflow-hidden shadow-md\">\n <div className=\"relative rounded-lg overflow-hidden border-2 border-[#11E5C5]\">\n <img\n src={imageUrl}\n alt=\"Selfie capturé\"\n className=\"w-full max-h-[50vh] object-contain bg-white\"\n onError={() => {\n setError(\"Impossible d'afficher l'image du selfie\");\n }}\n />\n {/* Overlay pour améliorer la lisibilité */}\n <div className=\"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/30 to-transparent p-3\">\n <p className=\"text-white text-xs text-center\">{t(\"selfie.confirmation.overlay_success\", \"Selfie capturé avec succès\")}</p>\n </div>\n </div>\n </div>\n\n {/* Checklist de confirmation */}\n <div className=\"bg-gray-50 p-4 rounded-lg\">\n <h3 className=\"font-medium text-sm mb-3\">{t(\"selfie.confirmation.checklist_title\", \"Vérifiez que :\")}</h3>\n <ul className=\"space-y-2 text-xs text-gray-700\">\n <li className=\"flex items-start\">\n <svg\n className=\"w-4 h-4 text-green-500 mr-2 mt-0.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n d=\"M5 13l4 4L19 7\"\n ></path>\n </svg>\n {t(\"selfie.confirmation.check_visible\", \"Votre visage est bien visible et occupe la majeure partie de l'image\")}\n </li>\n <li className=\"flex items-start\">\n <svg\n className=\"w-4 h-4 text-green-500 mr-2 mt-0.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n d=\"M5 13l4 4L19 7\"\n ></path>\n </svg>\n {t(\"selfie.confirmation.check_well_lit\", \"L'image est nette et bien éclairée\")}\n </li>\n <li className=\"flex items-start\">\n <svg\n className=\"w-4 h-4 text-green-500 mr-2 mt-0.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n d=\"M5 13l4 4L19 7\"\n ></path>\n </svg>\n {t(\"selfie.confirmation.check_no_object\", \"Aucun objet ne cache votre visage (lunettes de soleil, masque, etc.)\")}\n </li>\n </ul>\n </div>\n\n {/* Canvas caché utilisé pour le traitement des images */}\n <canvas ref={canvasRef} style={{ display: \"none\" }} />\n </div>\n </div>\n </MobilePageLayout>\n );\n};\n\nexport default SelfieConfirmation;\n"],"names":["useI18n","useState","useRef","useEffect","_jsx","_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,4BAA4B,EAAA,QAAA,EAElCA,cAAA,CAAA,MAAA,EAAA,EACE,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAC,GAAG,EACf,CAAC,EAAC,gBAAgB,EAAA,CACZ,EAAA,CACJ,EACL,CAAC,CAAC,qCAAqC,EAAE,sEAAsE,CAAC,CAAA,EAAA,CAC9G,IACF,CAAA,EAAA,CACD,EAGNA,cAAA,CAAA,QAAA,EAAA,EAAQ,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAA,CAAI,CAAA,EAAA,CAClD,EAAA,CACF,EAAA,CACW;AAEvB;;;;"}
1
+ {"version":3,"file":"SelfieConfirmation.js","sources":["../../../../../src/components/selfie/SelfieConfirmation.tsx"],"sourcesContent":["/**\n * SelfieConfirmation component\n *\n * Displays the captured selfie and allows the user to confirm or retake it.\n *\n * @param {Object} props - Component props\n * @param {SelfieCaptureData} props.selfieData - The captured selfie data containing media blob and metadata\n * @param {Function} props.onConfirm - Function called when user confirms the selfie\n * @param {Function} props.onRetake - Function called when user wants to retake the selfie\n * @returns {JSX.Element} The selfie confirmation UI component\n */\n\nimport { useEffect, useRef, useState } from \"react\";\nimport type { SelfieCaptureData } from \"../../types/selfie\";\nimport Button from \"../ui/Button\";\nimport PageActions from \"../ui/PageActions\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\nimport { useI18n } from \"../../hooks/useI18n\";\n\ninterface SelfieConfirmationProps {\n selfieData: SelfieCaptureData;\n setSelfiePhoto: (photo: string) => void;\n onConfirm: () => void;\n onRetake: () => void;\n}\n\nconst SelfieConfirmation = ({\n selfieData,\n setSelfiePhoto,\n onConfirm,\n onRetake,\n}: SelfieConfirmationProps) => {\n const { t } = useI18n();\n const [isLoading, setIsLoading] = useState(true);\n const [error, setError] = useState<string | null>(null);\n const [imageUrl, setImageUrl] = useState<string | null>(null);\n const canvasRef = useRef<HTMLCanvasElement>(null);\n\n useEffect(() => {\n setIsLoading(true);\n setError(null);\n\n if (!selfieData?.media) {\n setError(t(\"selfie.confirmation.errors.no_data\", \"Aucune donnée de selfie disponible\"));\n setIsLoading(false);\n return;\n }\n\n // Use pre-captured thumbnail from live video stream\n if (selfieData.thumbnail) {\n setImageUrl(selfieData.thumbnail);\n setSelfiePhoto(selfieData.thumbnail);\n setIsLoading(false);\n return;\n }\n\n // No thumbnail available (should not happen)\n setError(t(\"selfie.confirmation.errors.no_preview\", \"Aucune preview disponible\"));\n setIsLoading(false);\n }, [selfieData, setSelfiePhoto]);\n\n if (isLoading) {\n return (\n <div className=\"flex flex-col items-center justify-center h-full bg-white\">\n <div className=\"text-center p-6\">\n <div className=\"mb-4 text-gray-700\">\n {t(\"selfie.confirmation.loading\", \"Traitement de votre selfie...\")}\n </div>\n <div className=\"w-12 h-12 border-4 border-[#11E5C5] border-t-transparent rounded-full animate-spin mx-auto\"></div>\n </div>\n </div>\n );\n }\n\n if (error) {\n return (\n <div className=\"flex flex-col items-center justify-center h-full bg-white\">\n <div className=\"text-center p-6 max-w-md mx-auto\">\n <div className=\"w-16 h-16 mx-auto mb-4 text-red-500\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n <line x1=\"15\" y1=\"9\" x2=\"9\" y2=\"15\"></line>\n <line x1=\"9\" y1=\"9\" x2=\"15\" y2=\"15\"></line>\n </svg>\n </div>\n <Title className=\"text-xl mb-2\">{t(\"selfie.confirmation.error_title\", \"Une erreur est survenue\")}</Title>\n <p className=\"mb-6 text-sm text-gray-600\">{error}</p>\n <Button variant=\"secondary\" onClick={onRetake} className=\"md:max-w-xs mx-auto\">\n {t(\"selfie.confirmation.retake\", \"Reprendre le selfie\")}\n </Button>\n </div>\n </div>\n );\n }\n\n if (!imageUrl) {\n return (\n <div className=\"flex flex-col items-center justify-center h-full bg-white\">\n <div className=\"text-center p-6 max-w-md mx-auto\">\n <div className=\"w-16 h-16 mx-auto mb-4 text-yellow-500\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n <line x1=\"12\" y1=\"8\" x2=\"12\" y2=\"12\"></line>\n <line x1=\"12\" y1=\"16\" x2=\"12.01\" y2=\"16\"></line>\n </svg>\n </div>\n <Title className=\"text-xl mb-2\">{t(\"selfie.confirmation.no_display_title\", \"Impossible d'afficher le selfie\")}</Title>\n <p className=\"mb-6 text-sm text-gray-600\">{t(\"selfie.confirmation.no_display_desc\", \"Nous n'avons pas pu traiter correctement votre selfie.\")}</p>\n <Button variant=\"secondary\" onClick={onRetake} className=\"md:max-w-xs mx-auto\">\n {t(\"selfie.confirmation.retake\", \"Reprendre le selfie\")}\n </Button>\n </div>\n </div>\n );\n }\n\n return (\n <MobilePageLayout\n header={\n <div className=\"p-4 text-center bg-white border-b border-gray-100\">\n <Title className=\"text-xl md:text-2xl\">{t(\"selfie.confirmation.title\", \"Confirmez votre selfie\")}</Title>\n <Subtitle className=\"text-xs text-gray-600 mt-2 md:text-sm\">{t(\"selfie.confirmation.subtitle\", \"Vérifiez que votre visage est clairement visible\")}</Subtitle>\n </div>\n }\n footer={\n <PageActions\n primary={\n <Button onClick={onConfirm}>\n {t(\"selfie.confirmation.confirm\", \"Confirmer\")}\n </Button>\n }\n secondary={\n <Button variant=\"secondary\" onClick={onRetake}>\n {t(\"selfie.confirmation.retake\", \"Reprendre le selfie\")}\n </Button>\n }\n />\n }\n className=\"bg-white\"\n >\n <div className=\"px-4 py-6 md:px-8 md:py-8\">\n <div className=\"w-full max-w-md mx-auto space-y-6\">\n {/* Selfie display with frame */}\n <div className=\"w-full bg-white rounded-lg shadow-md\">\n <div className=\"relative rounded-lg border-2 border-[#11E5C5] flex items-center justify-center bg-white\">\n <img\n src={imageUrl}\n alt=\"Selfie capturé\"\n className=\"w-full h-auto object-contain rounded-lg\"\n style={{ maxHeight: \"50vh\" }}\n onError={() => {\n setError(\"Impossible d'afficher l'image du selfie\");\n }}\n />\n {/* Overlay pour améliorer la lisibilité */}\n <div className=\"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/30 to-transparent p-3\">\n <p className=\"text-white text-xs text-center\">{t(\"selfie.confirmation.overlay_success\", \"Selfie capturé avec succès\")}</p>\n </div>\n </div>\n </div>\n\n {/* Checklist de confirmation */}\n <div className=\"bg-gray-50 p-4 rounded-lg\">\n <h3 className=\"font-medium text-sm mb-3\">{t(\"selfie.confirmation.checklist_title\", \"Vérifiez que :\")}</h3>\n <ul className=\"space-y-2 text-xs text-gray-700\">\n <li className=\"flex items-start\">\n <svg\n className=\"w-4 h-4 text-green-500 mr-2 mt-0.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n d=\"M5 13l4 4L19 7\"\n ></path>\n </svg>\n {t(\"selfie.confirmation.check_visible\", \"Votre visage est bien visible et occupe la majeure partie de l'image\")}\n </li>\n <li className=\"flex items-start\">\n <svg\n className=\"w-4 h-4 text-green-500 mr-2 mt-0.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n d=\"M5 13l4 4L19 7\"\n ></path>\n </svg>\n {t(\"selfie.confirmation.check_well_lit\", \"L'image est nette et bien éclairée\")}\n </li>\n <li className=\"flex items-start\">\n <svg\n className=\"w-4 h-4 text-green-500 mr-2 mt-0.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n d=\"M5 13l4 4L19 7\"\n ></path>\n </svg>\n {t(\"selfie.confirmation.check_no_object\", \"Aucun objet ne cache votre visage (lunettes de soleil, masque, etc.)\")}\n </li>\n </ul>\n </div>\n\n {/* Canvas caché utilisé pour le traitement des images */}\n <canvas ref={canvasRef} style={{ display: \"none\" }} />\n </div>\n </div>\n </MobilePageLayout>\n );\n};\n\nexport default SelfieConfirmation;\n"],"names":["useI18n","useState","useRef","useEffect","_jsx","_jsxs","Title","Button","MobilePageLayout","Subtitle","PageActions"],"mappings":";;;;;;;;;;;;;AA4BA,IAAM,kBAAkB,GAAG,UAAC,EAKF,EAAA;QAJxB,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,cAAc,GAAA,EAAA,CAAA,cAAA,EACd,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,QAAQ,GAAA,EAAA,CAAA,QAAA;AAEA,IAAA,IAAA,CAAC,GAAKA,eAAO,EAAE,EAAd;IACH,IAAA,EAAA,GAA4BC,cAAQ,CAAC,IAAI,CAAC,EAAzC,SAAS,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,YAAY,GAAA,EAAA,CAAA,CAAA,CAAkB;IAC1C,IAAA,EAAA,GAAoBA,cAAQ,CAAgB,IAAI,CAAC,EAAhD,KAAK,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,QAAQ,GAAA,EAAA,CAAA,CAAA,CAAiC;IACjD,IAAA,EAAA,GAA0BA,cAAQ,CAAgB,IAAI,CAAC,EAAtD,QAAQ,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,WAAW,GAAA,EAAA,CAAA,CAAA,CAAiC;AAC7D,IAA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9C,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,4BAA4B,EAAA,QAAA,EAElCA,cAAA,CAAA,MAAA,EAAA,EACE,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAC,GAAG,EACf,CAAC,EAAC,gBAAgB,EAAA,CACZ,EAAA,CACJ,EACL,CAAC,CAAC,oCAAoC,EAAE,oCAAoC,CAAC,CAAA,EAAA,CAC3E,EACLC,eAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,kBAAkB,EAAA,QAAA,EAAA,CAC9BD,cAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAC,oCAAoC,EAC9C,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,4BAA4B,EAAA,QAAA,EAElCA,cAAA,CAAA,MAAA,EAAA,EACE,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAC,GAAG,EACf,CAAC,EAAC,gBAAgB,EAAA,CACZ,EAAA,CACJ,EACL,CAAC,CAAC,qCAAqC,EAAE,sEAAsE,CAAC,CAAA,EAAA,CAC9G,IACF,CAAA,EAAA,CACD,EAGNA,cAAA,CAAA,QAAA,EAAA,EAAQ,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAA,CAAI,CAAA,EAAA,CAClD,EAAA,CACF,EAAA,CACW;AAEvB;;;;"}
@@ -8,13 +8,13 @@ var React = require('react');
8
8
  * Hook personnalisé pour injecter des styles CSS globaux qui ciblent spécifiquement
9
9
  * le composant VideoRecorder d'Unissey et éliminent les bords arrondis et les fonds noirs.
10
10
  */
11
- var useVideoRecorderStyles = function () {
11
+ var useVideoRecorderStyles = function (btnBg, btnText) {
12
12
  React.useEffect(function () {
13
13
  // Créer un élément style pour injecter des règles CSS
14
14
  var styleElement = document.createElement("style");
15
15
  styleElement.id = "video-recorder-custom-styles";
16
16
  // Définir les règles CSS nécessaires pour éliminer les bords arrondis et les fonds noirs
17
- styleElement.textContent = "\n /* Cibler le composant VideoRecorder et tous ses \u00E9l\u00E9ments internes */\n uni-video-recorder,\n uni-video-recorder::shadow-root,\n uni-video-recorder::part(*),\n uni-video-recorder *,\n uni-video-recorder video,\n uni-video-recorder canvas,\n uni-video-recorder div {\n border-radius: 0 !important;\n -webkit-border-radius: 0 !important;\n -moz-border-radius: 0 !important;\n background: transparent !important;\n overflow: hidden !important;\n }\n \n /* Assurer que la vid\u00E9o prend tout l'espace disponible */\n uni-video-recorder video,\n uni-video-recorder canvas {\n width: 100% !important;\n height: 100% !important;\n object-fit: cover !important;\n max-height: none !important;\n }\n\n /* iOS-specific fixes for getUserMedia black screen */\n @supports (-webkit-touch-callout: none) {\n uni-video-recorder video {\n -webkit-playsinline: true !important;\n playsinline: true !important;\n autoplay: true !important;\n muted: true !important;\n }\n }\n \n /* Variables CSS globales que le composant pourrait utiliser */\n :root {\n --uni-video-border-radius: 0 !important;\n --uni-border-radius: 0 !important;\n --uni-component-border-radius: 0 !important;\n --uni-video-background: transparent !important;\n --uni-background: transparent !important;\n }\n \n /* S\u00E9lecteurs tr\u00E8s sp\u00E9cifiques pour garantir que les styles s'appliquent */\n .video-container,\n .video-container > div,\n .video-container > div > uni-video-recorder,\n .video-container uni-video-recorder,\n .selfie .video-container,\n .selfie .video-container > div,\n .selfie .video-container uni-video-recorder {\n border-radius: 0 !important;\n background: transparent !important;\n overflow: hidden !important;\n }\n \n /* Pr\u00E9server les styles des boutons */\n .selfie button.selfie-button,\n button.selfie-button,\n .selfie-button {\n background-color: #11E5C5 !important;\n color: #3C3C40 !important;\n border-radius: 12px !important;\n }\n \n .selfie button.selfie-button:hover,\n button.selfie-button:hover,\n .selfie-button:hover {\n background-color: #7dffeb !important;\n }\n \n .selfie button.selfie-button:disabled,\n button.selfie-button:disabled,\n .selfie-button:disabled {\n background-color: #e2e8f0 !important;\n opacity: 0.6 !important;\n }\n ";
17
+ styleElement.textContent = "\n /* Cibler le composant VideoRecorder et tous ses \u00E9l\u00E9ments internes */\n uni-video-recorder,\n uni-video-recorder::shadow-root,\n uni-video-recorder::part(*),\n uni-video-recorder *,\n uni-video-recorder video,\n uni-video-recorder canvas,\n uni-video-recorder div {\n border-radius: 0 !important;\n -webkit-border-radius: 0 !important;\n -moz-border-radius: 0 !important;\n background: transparent !important;\n overflow: hidden !important;\n }\n \n /* Assurer que la vid\u00E9o prend tout l'espace disponible */\n uni-video-recorder video,\n uni-video-recorder canvas {\n width: 100% !important;\n height: 100% !important;\n object-fit: cover !important;\n max-height: none !important;\n }\n\n /* iOS-specific fixes for getUserMedia black screen */\n @supports (-webkit-touch-callout: none) {\n uni-video-recorder video {\n -webkit-playsinline: true !important;\n playsinline: true !important;\n autoplay: true !important;\n muted: true !important;\n }\n }\n \n /* Variables CSS globales que le composant pourrait utiliser */\n :root {\n --uni-video-border-radius: 0 !important;\n --uni-border-radius: 0 !important;\n --uni-component-border-radius: 0 !important;\n --uni-video-background: transparent !important;\n --uni-background: transparent !important;\n }\n \n /* S\u00E9lecteurs tr\u00E8s sp\u00E9cifiques pour garantir que les styles s'appliquent */\n .video-container,\n .video-container > div,\n .video-container > div > uni-video-recorder,\n .video-container uni-video-recorder,\n .selfie .video-container,\n .selfie .video-container > div,\n .selfie .video-container uni-video-recorder {\n border-radius: 0 !important;\n background: transparent !important;\n overflow: hidden !important;\n }\n \n /* Pr\u00E9server les styles des boutons */\n .selfie button.selfie-button,\n button.selfie-button,\n .selfie-button {\n background-color: ".concat(btnBg !== null && btnBg !== void 0 ? btnBg : "#11E5C5", " !important;\n color: ").concat(btnText !== null && btnText !== void 0 ? btnText : "#3C3C40", " !important;\n border-radius: 12px !important;\n }\n\n .selfie button.selfie-button:hover,\n button.selfie-button:hover,\n .selfie-button:hover {\n background-color: ").concat(btnBg !== null && btnBg !== void 0 ? btnBg : "#11E5C5", " !important;\n filter: brightness(1.1);\n }\n\n .selfie button.selfie-button:disabled,\n button.selfie-button:disabled,\n .selfie-button:disabled {\n background-color: #e2e8f0 !important;\n opacity: 0.6 !important;\n }\n ");
18
18
  // Ajouter l'élément style au head du document
19
19
  document.head.appendChild(styleElement);
20
20
  // Nettoyer en supprimant l'élément style lors du démontage du composant
@@ -1 +1 @@
1
- {"version":3,"file":"useVideoRecorderStyles.js","sources":["../../../../../../src/components/selfie/hooks/useVideoRecorderStyles.tsx"],"sourcesContent":["import { useEffect } from \"react\";\n\n/**\n * Hook personnalisé pour injecter des styles CSS globaux qui ciblent spécifiquement\n * le composant VideoRecorder d'Unissey et éliminent les bords arrondis et les fonds noirs.\n */\nconst useVideoRecorderStyles = () => {\n useEffect(() => {\n // Créer un élément style pour injecter des règles CSS\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"video-recorder-custom-styles\";\n\n // Définir les règles CSS nécessaires pour éliminer les bords arrondis et les fonds noirs\n styleElement.textContent = `\n /* Cibler le composant VideoRecorder et tous ses éléments internes */\n uni-video-recorder,\n uni-video-recorder::shadow-root,\n uni-video-recorder::part(*),\n uni-video-recorder *,\n uni-video-recorder video,\n uni-video-recorder canvas,\n uni-video-recorder div {\n border-radius: 0 !important;\n -webkit-border-radius: 0 !important;\n -moz-border-radius: 0 !important;\n background: transparent !important;\n overflow: hidden !important;\n }\n \n /* Assurer que la vidéo prend tout l'espace disponible */\n uni-video-recorder video,\n uni-video-recorder canvas {\n width: 100% !important;\n height: 100% !important;\n object-fit: cover !important;\n max-height: none !important;\n }\n\n /* iOS-specific fixes for getUserMedia black screen */\n @supports (-webkit-touch-callout: none) {\n uni-video-recorder video {\n -webkit-playsinline: true !important;\n playsinline: true !important;\n autoplay: true !important;\n muted: true !important;\n }\n }\n \n /* Variables CSS globales que le composant pourrait utiliser */\n :root {\n --uni-video-border-radius: 0 !important;\n --uni-border-radius: 0 !important;\n --uni-component-border-radius: 0 !important;\n --uni-video-background: transparent !important;\n --uni-background: transparent !important;\n }\n \n /* Sélecteurs très spécifiques pour garantir que les styles s'appliquent */\n .video-container,\n .video-container > div,\n .video-container > div > uni-video-recorder,\n .video-container uni-video-recorder,\n .selfie .video-container,\n .selfie .video-container > div,\n .selfie .video-container uni-video-recorder {\n border-radius: 0 !important;\n background: transparent !important;\n overflow: hidden !important;\n }\n \n /* Préserver les styles des boutons */\n .selfie button.selfie-button,\n button.selfie-button,\n .selfie-button {\n background-color: #11E5C5 !important;\n color: #3C3C40 !important;\n border-radius: 12px !important;\n }\n \n .selfie button.selfie-button:hover,\n button.selfie-button:hover,\n .selfie-button:hover {\n background-color: #7dffeb !important;\n }\n \n .selfie button.selfie-button:disabled,\n button.selfie-button:disabled,\n .selfie-button:disabled {\n background-color: #e2e8f0 !important;\n opacity: 0.6 !important;\n }\n `;\n\n // Ajouter l'élément style au head du document\n document.head.appendChild(styleElement);\n\n // Nettoyer en supprimant l'élément style lors du démontage du composant\n return () => {\n const existingStyle = document.getElementById(\n \"video-recorder-custom-styles\"\n );\n if (existingStyle) {\n document.head.removeChild(existingStyle);\n }\n };\n }, []);\n};\n\nexport default useVideoRecorderStyles;\n"],"names":["useEffect"],"mappings":";;;;;;AAEA;;;AAGG;AACH,IAAM,sBAAsB,GAAG,YAAA;AAC7B,IAAAA,eAAS,CAAC,YAAA;;QAER,IAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC;AACpD,QAAA,YAAY,CAAC,EAAE,GAAG,8BAA8B;;AAGhD,QAAA,YAAY,CAAC,WAAW,GAAG,6pFA8E1B;;AAGD,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC;;QAGvC,OAAO,YAAA;YACL,IAAM,aAAa,GAAG,QAAQ,CAAC,cAAc,CAC3C,8BAA8B,CAC/B;YACD,IAAI,aAAa,EAAE;AACjB,gBAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC;YAC1C;AACF,QAAA,CAAC;IACH,CAAC,EAAE,EAAE,CAAC;AACR;;;;"}
1
+ {"version":3,"file":"useVideoRecorderStyles.js","sources":["../../../../../../src/components/selfie/hooks/useVideoRecorderStyles.tsx"],"sourcesContent":["import { useEffect } from \"react\";\n\n/**\n * Hook personnalisé pour injecter des styles CSS globaux qui ciblent spécifiquement\n * le composant VideoRecorder d'Unissey et éliminent les bords arrondis et les fonds noirs.\n */\nconst useVideoRecorderStyles = (btnBg?: string, btnText?: string) => {\n useEffect(() => {\n // Créer un élément style pour injecter des règles CSS\n const styleElement = document.createElement(\"style\");\n styleElement.id = \"video-recorder-custom-styles\";\n\n // Définir les règles CSS nécessaires pour éliminer les bords arrondis et les fonds noirs\n styleElement.textContent = `\n /* Cibler le composant VideoRecorder et tous ses éléments internes */\n uni-video-recorder,\n uni-video-recorder::shadow-root,\n uni-video-recorder::part(*),\n uni-video-recorder *,\n uni-video-recorder video,\n uni-video-recorder canvas,\n uni-video-recorder div {\n border-radius: 0 !important;\n -webkit-border-radius: 0 !important;\n -moz-border-radius: 0 !important;\n background: transparent !important;\n overflow: hidden !important;\n }\n \n /* Assurer que la vidéo prend tout l'espace disponible */\n uni-video-recorder video,\n uni-video-recorder canvas {\n width: 100% !important;\n height: 100% !important;\n object-fit: cover !important;\n max-height: none !important;\n }\n\n /* iOS-specific fixes for getUserMedia black screen */\n @supports (-webkit-touch-callout: none) {\n uni-video-recorder video {\n -webkit-playsinline: true !important;\n playsinline: true !important;\n autoplay: true !important;\n muted: true !important;\n }\n }\n \n /* Variables CSS globales que le composant pourrait utiliser */\n :root {\n --uni-video-border-radius: 0 !important;\n --uni-border-radius: 0 !important;\n --uni-component-border-radius: 0 !important;\n --uni-video-background: transparent !important;\n --uni-background: transparent !important;\n }\n \n /* Sélecteurs très spécifiques pour garantir que les styles s'appliquent */\n .video-container,\n .video-container > div,\n .video-container > div > uni-video-recorder,\n .video-container uni-video-recorder,\n .selfie .video-container,\n .selfie .video-container > div,\n .selfie .video-container uni-video-recorder {\n border-radius: 0 !important;\n background: transparent !important;\n overflow: hidden !important;\n }\n \n /* Préserver les styles des boutons */\n .selfie button.selfie-button,\n button.selfie-button,\n .selfie-button {\n background-color: ${btnBg ?? \"#11E5C5\"} !important;\n color: ${btnText ?? \"#3C3C40\"} !important;\n border-radius: 12px !important;\n }\n\n .selfie button.selfie-button:hover,\n button.selfie-button:hover,\n .selfie-button:hover {\n background-color: ${btnBg ?? \"#11E5C5\"} !important;\n filter: brightness(1.1);\n }\n\n .selfie button.selfie-button:disabled,\n button.selfie-button:disabled,\n .selfie-button:disabled {\n background-color: #e2e8f0 !important;\n opacity: 0.6 !important;\n }\n `;\n\n // Ajouter l'élément style au head du document\n document.head.appendChild(styleElement);\n\n // Nettoyer en supprimant l'élément style lors du démontage du composant\n return () => {\n const existingStyle = document.getElementById(\n \"video-recorder-custom-styles\"\n );\n if (existingStyle) {\n document.head.removeChild(existingStyle);\n }\n };\n }, []);\n};\n\nexport default useVideoRecorderStyles;\n"],"names":["useEffect"],"mappings":";;;;;;AAEA;;;AAGG;AACH,IAAM,sBAAsB,GAAG,UAAC,KAAc,EAAE,OAAgB,EAAA;AAC9D,IAAAA,eAAS,CAAC,YAAA;;QAER,IAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC;AACpD,QAAA,YAAY,CAAC,EAAE,GAAG,8BAA8B;;AAGhD,QAAA,YAAY,CAAC,WAAW,GAAG,2qEAAA,CAAA,MAAA,CA6DH,KAAK,KAAA,IAAA,IAAL,KAAK,KAAA,MAAA,GAAL,KAAK,GAAI,SAAS,EAAA,+BAAA,CAAA,CAAA,MAAA,CAC7B,OAAO,KAAA,IAAA,IAAP,OAAO,KAAA,MAAA,GAAP,OAAO,GAAI,SAAS,EAAA,0MAAA,CAAA,CAAA,MAAA,CAOT,KAAK,KAAA,IAAA,IAAL,KAAK,KAAA,MAAA,GAAL,KAAK,GAAI,SAAS,EAAA,gRAAA,CAUzC;;AAGD,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC;;QAGvC,OAAO,YAAA;YACL,IAAM,aAAa,GAAG,QAAQ,CAAC,cAAc,CAC3C,8BAA8B,CAC/B;YACD,IAAI,aAAa,EAAE;AACjB,gBAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC;YAC1C;AACF,QAAA,CAAC;IACH,CAAC,EAAE,EAAE,CAAC;AACR;;;;"}
@@ -9,8 +9,9 @@ var InstructionsSelfie = require('./InstructionsSelfie.js');
9
9
  var SelfieRecorder = require('./SelfieRecorder.js');
10
10
 
11
11
  var SelfieFlow = function (_a) {
12
+ var _b;
12
13
  var handleSelfie = _a.handleSelfie, onBack = _a.onBack, btnBg = _a.btnBg, btnText = _a.btnText;
13
- var _b = React.useState(-1), internalStep = _b[0], setInternalStep = _b[1]; // Commencer à -1 pour la pré-introduction
14
+ var _c = React.useState(-1), internalStep = _c[0], setInternalStep = _c[1]; // Commencer à -1 pour la pré-introduction
14
15
  var handleBack = function () {
15
16
  if (internalStep > -1) {
16
17
  setInternalStep(internalStep - 1);
@@ -20,7 +21,10 @@ var SelfieFlow = function (_a) {
20
21
  onBack();
21
22
  }
22
23
  };
23
- return (jsxRuntime.jsxs("div", { className: "h-full w-full flex flex-col", children: [internalStep === -1 && (jsxRuntime.jsx("div", { className: "flex-1 flex flex-col h-full", children: jsxRuntime.jsx(SelfiePreIntroduction.default, { onContinue: function () { return setInternalStep(0); }, onBack: handleBack }) })), internalStep === 0 && (jsxRuntime.jsx("div", { className: "flex-1 flex flex-col h-full", children: jsxRuntime.jsx(InstructionsSelfie.default, { setStep: setInternalStep, onBack: function () { return setInternalStep(-1); } }) })), internalStep === 1 && (jsxRuntime.jsx("div", { className: "flex-1 flex flex-col h-full overflow-hidden", children: jsxRuntime.jsx(SelfieRecorder.default, { handleSelfie: handleSelfie, btnBg: btnBg, btnText: btnText }) }))] }));
24
+ return (jsxRuntime.jsxs("div", { className: "h-full w-full flex flex-col", style: (_b = {},
25
+ _b["--dk-btn-bg"] = btnBg !== null && btnBg !== void 0 ? btnBg : "#11E5C5",
26
+ _b["--dk-btn-text"] = btnText !== null && btnText !== void 0 ? btnText : "#3C3C40",
27
+ _b), children: [internalStep === -1 && (jsxRuntime.jsx("div", { className: "flex-1 flex flex-col h-full", children: jsxRuntime.jsx(SelfiePreIntroduction.default, { onContinue: function () { return setInternalStep(0); }, onBack: handleBack }) })), internalStep === 0 && (jsxRuntime.jsx("div", { className: "flex-1 flex flex-col h-full", children: jsxRuntime.jsx(InstructionsSelfie.default, { setStep: setInternalStep, onBack: function () { return setInternalStep(-1); } }) })), internalStep === 1 && (jsxRuntime.jsx("div", { className: "flex-1 flex flex-col h-full overflow-hidden", children: jsxRuntime.jsx(SelfieRecorder.default, { handleSelfie: handleSelfie, btnBg: btnBg, btnText: btnText }) }))] }));
24
28
  };
25
29
 
26
30
  exports.default = SelfieFlow;
@@ -1 +1 @@
1
- {"version":3,"file":"SelfieFlow.js","sources":["../../../../../../src/components/selfie/selfie-flow/SelfieFlow.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport SelfiePreIntroduction from \"./SelfiePreIntroduction\";\nimport InstructionsSelfie from \"./InstructionsSelfie\";\nimport SelfieRecorder from \"./SelfieRecorder\";\n\ninterface SelfieFlowProps {\n handleSelfie: (e: Event) => void;\n onBack?: () => void;\n btnBg?: string;\n btnText?: string;\n}\n\nconst SelfieFlow = ({ handleSelfie, onBack, btnBg, btnText }: SelfieFlowProps) => {\n const [internalStep, setInternalStep] = useState(-1); // Commencer à -1 pour la pré-introduction\n\n const handleBack = () => {\n if (internalStep > -1) {\n setInternalStep(internalStep - 1);\n } else if (internalStep === -1 && onBack) {\n // Si on est à la première étape et qu'on a une fonction de retour parent, l'utiliser\n onBack();\n }\n };\n\n return (\n <div className=\"h-full w-full flex flex-col\">\n {internalStep === -1 && (\n <div className=\"flex-1 flex flex-col h-full\">\n <SelfiePreIntroduction\n onContinue={() => setInternalStep(0)}\n onBack={handleBack}\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 <SelfieRecorder handleSelfie={handleSelfie} btnBg={btnBg} btnText={btnText} />\n </div>\n )}\n </div>\n );\n};\n\nexport default SelfieFlow;\n"],"names":["useState","_jsxs","_jsx","SelfiePreIntroduction","InstructionsSelfie","SelfieRecorder"],"mappings":";;;;;;;;;;AAYA,IAAM,UAAU,GAAG,UAAC,EAAyD,EAAA;QAAvD,YAAY,GAAA,EAAA,CAAA,YAAA,EAAE,MAAM,GAAA,EAAA,CAAA,MAAA,EAAE,KAAK,GAAA,EAAA,CAAA,KAAA,EAAE,OAAO,GAAA,EAAA,CAAA,OAAA;AAClD,IAAA,IAAA,EAAA,GAAkCA,cAAQ,CAAC,EAAE,CAAC,EAA7C,YAAY,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,eAAe,GAAA,EAAA,CAAA,CAAA,CAAgB,CAAC;AAErD,IAAA,IAAM,UAAU,GAAG,YAAA;AACjB,QAAA,IAAI,YAAY,GAAG,EAAE,EAAE;AACrB,YAAA,eAAe,CAAC,YAAY,GAAG,CAAC,CAAC;QACnC;AAAO,aAAA,IAAI,YAAY,KAAK,EAAE,IAAI,MAAM,EAAE;;AAExC,YAAA,MAAM,EAAE;QACV;AACF,IAAA,CAAC;IAED,QACEC,yBAAK,SAAS,EAAC,6BAA6B,EAAA,QAAA,EAAA,CACzC,YAAY,KAAK,EAAE,KAClBC,cAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,6BAA6B,YAC1CA,cAAA,CAACC,6BAAqB,EAAA,EACpB,UAAU,EAAE,YAAA,EAAM,OAAA,eAAe,CAAC,CAAC,CAAC,CAAA,CAAlB,CAAkB,EACpC,MAAM,EAAE,UAAU,EAAA,CAClB,EAAA,CACE,CACP,EACA,YAAY,KAAK,CAAC,KACjBD,cAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,6BAA6B,EAAA,QAAA,EAC1CA,cAAA,CAACE,0BAAkB,EAAA,EACjB,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,YAAA,EAAM,OAAA,eAAe,CAAC,EAAE,CAAC,CAAA,CAAnB,CAAmB,EAAA,CACjC,EAAA,CACE,CACP,EACA,YAAY,KAAK,CAAC,KACjBF,wBAAK,SAAS,EAAC,6CAA6C,EAAA,QAAA,EAC1DA,cAAA,CAACG,sBAAc,EAAA,EAAC,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAI,EAAA,CAC1E,CACP,CAAA,EAAA,CACG;AAEV;;;;"}
1
+ {"version":3,"file":"SelfieFlow.js","sources":["../../../../../../src/components/selfie/selfie-flow/SelfieFlow.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport SelfiePreIntroduction from \"./SelfiePreIntroduction\";\nimport InstructionsSelfie from \"./InstructionsSelfie\";\nimport SelfieRecorder from \"./SelfieRecorder\";\n\ninterface SelfieFlowProps {\n handleSelfie: (e: Event) => void;\n onBack?: () => void;\n btnBg?: string;\n btnText?: string;\n}\n\nconst SelfieFlow = ({ handleSelfie, onBack, btnBg, btnText }: SelfieFlowProps) => {\n const [internalStep, setInternalStep] = useState(-1); // Commencer à -1 pour la pré-introduction\n\n const handleBack = () => {\n if (internalStep > -1) {\n setInternalStep(internalStep - 1);\n } else if (internalStep === -1 && onBack) {\n // Si on est à la première étape et qu'on a une fonction de retour parent, l'utiliser\n onBack();\n }\n };\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 onBack={handleBack}\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 <SelfieRecorder handleSelfie={handleSelfie} btnBg={btnBg} btnText={btnText} />\n </div>\n )}\n </div>\n );\n};\n\nexport default SelfieFlow;\n"],"names":["useState","_jsxs","_jsx","SelfiePreIntroduction","InstructionsSelfie","SelfieRecorder"],"mappings":";;;;;;;;;;AAYA,IAAM,UAAU,GAAG,UAAC,EAAyD,EAAA;;QAAvD,YAAY,GAAA,EAAA,CAAA,YAAA,EAAE,MAAM,GAAA,EAAA,CAAA,MAAA,EAAE,KAAK,GAAA,EAAA,CAAA,KAAA,EAAE,OAAO,GAAA,EAAA,CAAA,OAAA;AAClD,IAAA,IAAA,EAAA,GAAkCA,cAAQ,CAAC,EAAE,CAAC,EAA7C,YAAY,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,eAAe,GAAA,EAAA,CAAA,CAAA,CAAgB,CAAC;AAErD,IAAA,IAAM,UAAU,GAAG,YAAA;AACjB,QAAA,IAAI,YAAY,GAAG,EAAE,EAAE;AACrB,YAAA,eAAe,CAAC,YAAY,GAAG,CAAC,CAAC;QACnC;AAAO,aAAA,IAAI,YAAY,KAAK,EAAE,IAAI,MAAM,EAAE;;AAExC,YAAA,MAAM,EAAE;QACV;AACF,IAAA,CAAC;AAED,IAAA,QACEC,eAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAC,6BAA6B,EACvC,KAAK,GAAA,EAAA,GAAA,EAAA;YACH,EAAA,CAAC,aAAuB,IAAG,KAAK,KAAA,IAAA,IAAL,KAAK,KAAA,MAAA,GAAL,KAAK,GAAI,SAAS;YAC7C,EAAA,CAAC,eAAyB,IAAG,OAAO,KAAA,IAAA,IAAP,OAAO,KAAA,MAAA,GAAP,OAAO,GAAI,SAAS;4BAGlD,YAAY,KAAK,EAAE,KAClBC,cAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,6BAA6B,EAAA,QAAA,EAC1CA,eAACC,6BAAqB,EAAA,EACpB,UAAU,EAAE,YAAA,EAAM,OAAA,eAAe,CAAC,CAAC,CAAC,CAAA,CAAlB,CAAkB,EACpC,MAAM,EAAE,UAAU,EAAA,CAClB,GACE,CACP,EACA,YAAY,KAAK,CAAC,KACjBD,cAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,6BAA6B,YAC1CA,cAAA,CAACE,0BAAkB,IACjB,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,YAAA,EAAM,OAAA,eAAe,CAAC,EAAE,CAAC,CAAA,CAAnB,CAAmB,EAAA,CACjC,EAAA,CACE,CACP,EACA,YAAY,KAAK,CAAC,KACjBF,cAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,6CAA6C,EAAA,QAAA,EAC1DA,eAACG,sBAAc,EAAA,EAAC,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAA,CAAI,GAC1E,CACP,CAAA,EAAA,CACG;AAEV;;;;"}
@@ -26,7 +26,7 @@ var SelfieRecorder = function (_a) {
26
26
  var _g = React.useState("idle"), recordingState = _g[0], setRecordingState = _g[1];
27
27
  var capturedThumbnailRef = React.useRef(null);
28
28
  var _h = useLiveFrameCapture.useLiveFrameCapture(), captureFrame = _h.captureFrame, cleanup = _h.cleanup;
29
- useVideoRecorderStyles.default();
29
+ useVideoRecorderStyles.default(btnBg, btnText);
30
30
  React.useEffect(function () {
31
31
  document.body.classList.add("recording-selfie");
32
32
  var cleanupObserver = videoElementStyles.setupVideoElementsObserver();
@@ -154,13 +154,13 @@ var SelfieRecorder = function (_a) {
154
154
  handleSelfie(enhancedEvent);
155
155
  };
156
156
  return (jsxRuntime.jsxs("div", { className: "selfie fixed inset-0 z-50 flex flex-col", style: (_b = {},
157
- _b["--dk-btn-bg"] = btnBg !== null && btnBg !== void 0 ? btnBg : "var(--dk-btn-bg)",
158
- _b["--dk-btn-text"] = btnText !== null && btnText !== void 0 ? btnText : "var(--dk-btn-text)",
157
+ _b["--dk-btn-bg"] = btnBg !== null && btnBg !== void 0 ? btnBg : "#11E5C5",
158
+ _b["--dk-btn-text"] = btnText !== null && btnText !== void 0 ? btnText : "#3C3C40",
159
159
  _b), children: [jsxRuntime.jsxs("div", { className: "p-4 text-center bg-white shrink-0", children: [jsxRuntime.jsx(Title.default, { className: "text-lg md:text-xl mb-1", children: t("selfie.recorder.title") }), jsxRuntime.jsx(Subtitle.default, { className: "text-xs text-gray-600 md:text-sm", children: t("selfie.recorder.subtitle") })] }), jsxRuntime.jsx("div", { className: "video-container flex-1 relative overflow-hidden", children: jsxRuntime.jsx(sdkReact.VideoRecorder, tslib_es6.__assign({ ref: recorderRef, preset: sdkReact.AcquisitionPreset.SELFIE_OPTIMIZED, hideCaptureBtn: true, faceChecker: "enabled", disableDebugMode: true, onRecorderReady: handleRecorderReady, onRecordCompleted: handleRecordCompleted, onRecord: recordStarting, style: { width: "100%", height: "100%" }, className: "video-recorder-no-radius w-full h-full" }, (selfieCaptureUtils.isIOS() && {
160
160
  "data-playsinline": "true",
161
161
  "data-autoplay": "true",
162
162
  "data-muted": "true"
163
- }), { strings: unisseyStrings.getUnisseyStrings(t) })) }), jsxRuntime.jsx("div", { className: "shrink-0 bg-white border-t border-gray-200 p-4 md:p-6 relative", style: { zIndex: 9999 }, children: jsxRuntime.jsxs("div", { className: "max-w-md mx-auto", children: [jsxRuntime.jsx("div", { className: "text-center text-xs text-gray-400 mt-3", children: t("selfie.recorder.note") }), jsxRuntime.jsxs(Button.default, { onClick: recordStarting, className: "w-full py-3 md:py-4 relative selfie-button", disabled: disableButton || !recorderReady, children: [recordingState === "idle" && t("selfie.recorder.start"), recordingState === "preparing" && t("selfie.recorder.preparing"), recordingState === "recording" && (jsxRuntime.jsxs("span", { className: "flex items-center justify-center", children: [jsxRuntime.jsx("span", { className: "mr-2", children: t("selfie.recorder.recording_label") }), jsxRuntime.jsxs("span", { className: "flex space-x-1 loading-dots", children: [jsxRuntime.jsx("span", { className: "h-1 w-1 bg-white rounded-full" }), jsxRuntime.jsx("span", { className: "h-1 w-1 bg-white rounded-full" }), jsxRuntime.jsx("span", { className: "h-1 w-1 bg-white rounded-full" })] })] })), recordingState === "processing" && t("selfie.recorder.processing")] })] }) })] }));
163
+ }), { strings: unisseyStrings.getUnisseyStrings(t) })) }), jsxRuntime.jsx("div", { className: "shrink-0 bg-white border-t border-gray-200 p-4 md:p-6 relative", style: { zIndex: 9999 }, children: jsxRuntime.jsxs("div", { className: "max-w-md mx-auto", children: [jsxRuntime.jsx("div", { className: "text-center text-xs text-gray-400 mt-3", children: t("selfie.recorder.note") }), jsxRuntime.jsxs(Button.default, { onClick: recordStarting, className: "w-full py-3 md:py-4 relative selfie-button", disabled: disableButton || !recorderReady, style: { backgroundColor: btnBg !== null && btnBg !== void 0 ? btnBg : "#11E5C5", color: btnText !== null && btnText !== void 0 ? btnText : "#3C3C40" }, children: [recordingState === "idle" && t("selfie.recorder.start"), recordingState === "preparing" && t("selfie.recorder.preparing"), recordingState === "recording" && (jsxRuntime.jsxs("span", { className: "flex items-center justify-center", children: [jsxRuntime.jsx("span", { className: "mr-2", children: t("selfie.recorder.recording_label") }), jsxRuntime.jsxs("span", { className: "flex space-x-1 loading-dots", children: [jsxRuntime.jsx("span", { className: "h-1 w-1 bg-white rounded-full" }), jsxRuntime.jsx("span", { className: "h-1 w-1 bg-white rounded-full" }), jsxRuntime.jsx("span", { className: "h-1 w-1 bg-white rounded-full" })] })] })), recordingState === "processing" && t("selfie.recorder.processing")] })] }) })] }));
164
164
  };
165
165
 
166
166
  exports.default = SelfieRecorder;
@@ -1 +1 @@
1
- {"version":3,"file":"SelfieRecorder.js","sources":["../../../../../../src/components/selfie/selfie-flow/SelfieRecorder.tsx"],"sourcesContent":["import { useRef, useState, useEffect } 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 { getUnisseyStrings } from \"../utils/unisseyStrings\";\n\ninterface SelfieRecorderProps {\n handleSelfie: (e: Event) => void;\n onBeginCapture?: () => void;\n isCapturing?: boolean;\n btnBg?: string;\n btnText?: string;\n}\n\ninterface VideoRecorderRef extends HTMLElement {\n capture: () => void;\n}\n\nconst SelfieRecorder = ({\n handleSelfie,\n onBeginCapture = () => { },\n isCapturing = false,\n btnBg,\n btnText,\n}: SelfieRecorderProps) => {\n const { t } = useI18n();\n const recorderRef = useRef<VideoRecorderRef | null>(null);\n const [disableButton, setDisableButton] = useState(false);\n const [recorderReady, setRecorderReady] = useState(false);\n const [recordingState, setRecordingState] = useState<\n \"idle\" | \"preparing\" | \"recording\" | \"processing\"\n >(\"idle\");\n const capturedThumbnailRef = useRef<string | null>(null);\n const { captureFrame, cleanup } = useLiveFrameCapture();\n\n useVideoRecorderStyles();\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 as any).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 setRecordingState(\"preparing\");\n setDisableButton(true);\n\n const triggerCapture = async () => {\n try {\n await waitForVideoFrame(recorderRef.current);\n await delay(200);\n setRecordingState(\"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 setRecordingState(\"idle\");\n setDisableButton(false);\n }\n };\n\n void triggerCapture();\n };\n\n const handleRecorderReady = () => setRecorderReady(true);\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 setRecordingState(\"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 setRecordingState(\"processing\");\n handleSelfie(enhancedEvent);\n };\n\n return (\n <div\n className=\"selfie fixed inset-0 z-50 flex flex-col\"\n style={{\n [\"--dk-btn-bg\" as string]: btnBg ?? \"var(--dk-btn-bg)\",\n [\"--dk-btn-text\" as string]: btnText ?? \"var(--dk-btn-text)\",\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 as any}\n preset={AcquisitionPreset.SELFIE_OPTIMIZED}\n hideCaptureBtn\n faceChecker=\"enabled\"\n disableDebugMode\n onRecorderReady={handleRecorderReady}\n onRecordCompleted={handleRecordCompleted}\n onRecord={recordStarting}\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 >\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":["useI18n","useRef","useState","useLiveFrameCapture","useVideoRecorderStyles","useEffect","setupVideoElementsObserver","isIOS","__awaiter","waitForVideoFrame","delay","getRecorderVideoElement","_jsxs","_jsx","Title","Subtitle","VideoRecorder","AcquisitionPreset","getUnisseyStrings","Button"],"mappings":";;;;;;;;;;;;;;;;;;AAwBA,IAAM,cAAc,GAAG,UAAC,EAMF,EAAA;;QALpB,YAAY,GAAA,EAAA,CAAA,YAAA,EACZ,EAAA,GAAA,EAAA,CAAA,cAA0B,CAAA,CAA1B,cAAc,GAAA,EAAA,KAAA,MAAA,GAAG,YAAA,EAAQ,CAAC,GAAA,EAAA,CAAA,eACP,CAAA,KACnB,KAAK,GAAA,EAAA,CAAA,KAAA,CAAA,CACL,OAAO,GAAA,EAAA,CAAA;AAEC,IAAA,IAAA,CAAC,GAAKA,eAAO,EAAE,EAAd;AACT,IAAA,IAAM,WAAW,GAAGC,YAAM,CAA0B,IAAI,CAAC;IACnD,IAAA,EAAA,GAAoCC,cAAQ,CAAC,KAAK,CAAC,EAAlD,aAAa,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CACF,CAAA,EAAA,CACF;AAEV;;;;"}
1
+ {"version":3,"file":"SelfieRecorder.js","sources":["../../../../../../src/components/selfie/selfie-flow/SelfieRecorder.tsx"],"sourcesContent":["import { useRef, useState, useEffect } 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 { getUnisseyStrings } from \"../utils/unisseyStrings\";\n\ninterface SelfieRecorderProps {\n handleSelfie: (e: Event) => void;\n onBeginCapture?: () => void;\n isCapturing?: boolean;\n btnBg?: string;\n btnText?: string;\n}\n\ninterface VideoRecorderRef extends HTMLElement {\n capture: () => void;\n}\n\nconst SelfieRecorder = ({\n handleSelfie,\n onBeginCapture = () => { },\n isCapturing = false,\n btnBg,\n btnText,\n}: SelfieRecorderProps) => {\n const { t } = useI18n();\n const recorderRef = useRef<VideoRecorderRef | null>(null);\n const [disableButton, setDisableButton] = useState(false);\n const [recorderReady, setRecorderReady] = useState(false);\n const [recordingState, setRecordingState] = useState<\n \"idle\" | \"preparing\" | \"recording\" | \"processing\"\n >(\"idle\");\n const capturedThumbnailRef = useRef<string | null>(null);\n const { captureFrame, cleanup } = useLiveFrameCapture();\n\n useVideoRecorderStyles(btnBg, btnText);\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 as any).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 setRecordingState(\"preparing\");\n setDisableButton(true);\n\n const triggerCapture = async () => {\n try {\n await waitForVideoFrame(recorderRef.current);\n await delay(200);\n setRecordingState(\"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 setRecordingState(\"idle\");\n setDisableButton(false);\n }\n };\n\n void triggerCapture();\n };\n\n const handleRecorderReady = () => setRecorderReady(true);\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 setRecordingState(\"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 setRecordingState(\"processing\");\n handleSelfie(enhancedEvent);\n };\n\n return (\n <div\n className=\"selfie fixed inset-0 z-50 flex flex-col\"\n style={{\n [\"--dk-btn-bg\" as string]: btnBg ?? \"#11E5C5\",\n [\"--dk-btn-text\" as string]: btnText ?? \"#3C3C40\",\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 as any}\n preset={AcquisitionPreset.SELFIE_OPTIMIZED}\n hideCaptureBtn\n faceChecker=\"enabled\"\n disableDebugMode\n onRecorderReady={handleRecorderReady}\n onRecordCompleted={handleRecordCompleted}\n onRecord={recordStarting}\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":["useI18n","useRef","useState","useLiveFrameCapture","useVideoRecorderStyles","useEffect","setupVideoElementsObserver","isIOS","__awaiter","waitForVideoFrame","delay","getRecorderVideoElement","_jsxs","_jsx","Title","Subtitle","VideoRecorder","AcquisitionPreset","getUnisseyStrings","Button"],"mappings":";;;;;;;;;;;;;;;;;;AAwBA,IAAM,cAAc,GAAG,UAAC,EAMF,EAAA;;QALpB,YAAY,GAAA,EAAA,CAAA,YAAA,EACZ,EAAA,GAAA,EAAA,CAAA,cAA0B,CAAA,CAA1B,cAAc,GAAA,EAAA,KAAA,MAAA,GAAG,YAAA,EAAQ,CAAC,GAAA,EAAA,CAAA,eACP,CAAA,KACnB,KAAK,GAAA,EAAA,CAAA,KAAA,CAAA,CACL,OAAO,G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C3CC,cAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,+BAA+B,EAAA,CAAQ,EACvDA,cAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,+BAA+B,EAAA,CAAQ,EACvDA,yBAAM,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;;;;"}
@@ -50,6 +50,7 @@ var Selfie = function (_a) {
50
50
  // Retourner à l'étape précédente du flow principal
51
51
  stepObject.setStep(stepObject.step - 1);
52
52
  };
53
+ console.log("[Selfie] buttonBgColor:", template.buttonBgColor, "buttonTextColor:", template.buttonTextColor);
53
54
  return (jsxRuntime.jsxs("div", { className: "h-full w-full transition-opacity duration-500 ".concat(isTransitioning ? "opacity-50" : "opacity-100"), children: [internalStep === 0 && (jsxRuntime.jsx(Video.default, { setSelfieData: setSelfieData, setStep: setInternalStep, onBack: handleBackToParent, btnBg: (_b = template.buttonBgColor) !== null && _b !== void 0 ? _b : "#11E5C5", btnText: (_c = template.buttonTextColor) !== null && _c !== void 0 ? _c : "#3C3C40" })), internalStep === 1 && selfieData && (jsxRuntime.jsx(SelfieConfirmation.default, { selfieData: selfieData, onConfirm: handleConfirmSelfie, onRetake: handleRetakeSelfie, setSelfiePhoto: setSelfiePhoto })), internalStep === 2 && selfieData && (jsxRuntime.jsx(SelfieProcessing.default, { onProcessingComplete: selfieProcessed, selfieVideo: selfieData, selfiePhoto: selfiePhoto, onRetake: onRetake }))] }));
54
55
  };
55
56
 
@@ -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 {\n updateSessionCurrentStep,\n getOrderedJourneySteps,\n} 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 // Increment currentStep in database immediately after successful analysis\n // This prevents double analysis if the user refreshes the page\n updateSessionCurrentStep(sessionId, stepObject.step + 1).catch((error) => {\n console.error(\"Failed to update current step after successful analysis:\", error);\n });\n stepObject.goToNextStep(node.id, template);\n }\n };\n\n const onRetake = () => {\n setInternalStep(0);\n };\n\n const handleRetakeSelfie = () => {\n setInternalStep(0);\n };\n\n const handleBackToParent = () => {\n // Retourner à l'étape précédente du flow principal\n stepObject.setStep(stepObject.step - 1);\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 onBack={handleBackToParent}\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 />\n )}\n </div>\n );\n};\n\nexport default Selfie;\n"],"names":["useState","updateSessionCurrentStep","_jsxs","_jsx","Video","SelfieConfirmation","SelfieProcessing"],"mappings":";;;;;;;;;;;AAeA;;;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,GAAkCA,cAAQ,CAAC,CAAC,CAAC,EAA5C,YAAY,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,eAAe,GAAA,EAAA,CAAA,CAAA,CAAe;IAC7C,IAAA,EAAA,GAA8BA,cAAQ,CAA2B,IAAI,CAAC,EAArE,UAAU,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,aAAa,GAAA,EAAA,CAAA,CAAA,CAA4C;IACtE,IAAA,EAAA,GAAgCA,cAAQ,CAAgB,IAAI,CAAC,EAA5D,WAAW,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,cAAc,GAAA,EAAA,CAAA,CAAA,CAAiC;IAC7D,IAAA,EAAA,GAAwCA,cAAQ,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,UAA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IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAI,SAAS,EAAA,CAC9C,CACH,EACA,YAAY,KAAK,CAAC,IAAI,UAAU,KAC/BD,eAACE,0BAAkB,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/BF,cAAA,CAACG,wBAAgB,EAAA,EACf,oBAAoB,EAAE,eAAe,EACrC,WAAW,EAAE,UAAU,EACvB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAAA,CAClB,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 {\n updateSessionCurrentStep,\n getOrderedJourneySteps,\n} 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 // Increment currentStep in database immediately after successful analysis\n // This prevents double analysis if the user refreshes the page\n updateSessionCurrentStep(sessionId, stepObject.step + 1).catch((error) => {\n console.error(\"Failed to update current step after successful analysis:\", error);\n });\n stepObject.goToNextStep(node.id, template);\n }\n };\n\n const onRetake = () => {\n setInternalStep(0);\n };\n\n const handleRetakeSelfie = () => {\n setInternalStep(0);\n };\n\n const handleBackToParent = () => {\n // Retourner à l'étape précédente du flow principal\n stepObject.setStep(stepObject.step - 1);\n };\n\n console.log(\"[Selfie] buttonBgColor:\", template.buttonBgColor, \"buttonTextColor:\", template.buttonTextColor);\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 onBack={handleBackToParent}\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 />\n )}\n </div>\n );\n};\n\nexport default Selfie;\n"],"names":["useState","updateSessionCurrentStep","_jsxs","_jsx","Video","SelfieConfirmation","SelfieProcessing"],"mappings":";;;;;;;;;;;AAeA;;;AAGG;AACH,IAAM,MAAM,GAAG,UAAC,EAUf,EAAA;;QATC,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,SAAS,GAAA,EAAA,CAAA,SAAA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AAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAAA,CAClB,CACH,CAAA,EAAA,CACG;AAEV;;;;"}
@@ -2,11 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var tslib_es6 = require('../../node_modules/tslib/tslib.es6.js');
5
6
  var jsxRuntime = require('react/jsx-runtime');
6
7
  var useIsMobile = require('../../hooks/useIsMobile.js');
7
8
 
8
9
  var Button = function (_a) {
9
- var _b = _a.variant, variant = _b === void 0 ? "primary" : _b, children = _a.children, _c = _a.className, className = _c === void 0 ? "" : _c, onClick = _a.onClick, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.type, type = _e === void 0 ? "button" : _e;
10
+ var _b, _c;
11
+ var _d = _a.variant, variant = _d === void 0 ? "primary" : _d, children = _a.children, _e = _a.className, className = _e === void 0 ? "" : _e, style = _a.style, onClick = _a.onClick, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.type, type = _g === void 0 ? "button" : _g;
10
12
  var isMobile = useIsMobile.default(768);
11
13
  var baseShared = "flex items-center justify-center gap-2 shrink-0 font-poppins text-sm font-medium leading-[110%] transition-filter";
12
14
  var base = isMobile
@@ -20,8 +22,8 @@ var Button = function (_a) {
20
22
  return (jsxRuntime.jsx("button", { type: type, className: "".concat(base, " ").concat(disabled
21
23
  ? "bg-gray-200 text-gray-400 cursor-not-allowed opacity-60"
22
24
  : "hover:brightness-110 active:brightness-90 cursor-pointer", " ").concat(className), style: disabled
23
- ? undefined
24
- : { backgroundColor: "var(--dk-btn-bg)", color: "var(--dk-btn-text)" }, onClick: onClick, disabled: disabled, children: children }));
25
+ ? style
26
+ : tslib_es6.__assign(tslib_es6.__assign({}, style), { backgroundColor: (_b = style === null || style === void 0 ? void 0 : style.backgroundColor) !== null && _b !== void 0 ? _b : "var(--dk-btn-bg)", color: (_c = style === null || style === void 0 ? void 0 : style.color) !== null && _c !== void 0 ? _c : "var(--dk-btn-text)" }), onClick: onClick, disabled: disabled, children: children }));
25
27
  };
26
28
 
27
29
  exports.default = Button;
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../../../../src/components/ui/Button.tsx"],"sourcesContent":["/**\n * Button component - Unified adaptive button\n *\n * Adapts automatically between mobile and desktop using useIsMobile hook\n * rather than CSS responsive classes, for build compatibility.\n *\n * - Mobile: full width, tall (h-[48px], rounded-[12px])\n * - Desktop: auto width, comfortable (h-10, px-8, min-w-[140px])\n *\n * @param variant - \"primary\" (filled, default) | \"secondary\" (outlined)\n */\nimport useIsMobile from \"../../hooks/useIsMobile\";\n\ninterface ButtonProps {\n variant?: \"primary\" | \"secondary\";\n children: React.ReactNode;\n className?: string;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n disabled?: boolean;\n type?: \"button\" | \"submit\" | \"reset\";\n}\n\nconst Button = ({\n variant = \"primary\",\n children,\n className = \"\",\n onClick,\n disabled = false,\n type = \"button\",\n}: ButtonProps) => {\n const isMobile = useIsMobile(768);\n\n const baseShared = \"flex items-center justify-center gap-2 shrink-0 font-poppins text-sm font-medium leading-[110%] transition-filter\";\n const base = isMobile\n ? `${baseShared} w-full h-[48px] rounded-[12px]`\n : `${baseShared} h-10 rounded-md px-8 min-w-[140px]`;\n\n if (variant === \"secondary\") {\n return (\n <button\n type={type}\n className={`${base} bg-transparent border border-gray-300 text-gray-600 ${\n disabled\n ? \"opacity-60 cursor-not-allowed\"\n : \"hover:bg-black/5 cursor-pointer\"\n } ${className}`}\n onClick={onClick}\n disabled={disabled}\n >\n {children}\n </button>\n );\n }\n\n return (\n <button\n type={type}\n className={`${base} ${\n disabled\n ? \"bg-gray-200 text-gray-400 cursor-not-allowed opacity-60\"\n : \"hover:brightness-110 active:brightness-90 cursor-pointer\"\n } ${className}`}\n style={\n disabled\n ? undefined\n : { backgroundColor: \"var(--dk-btn-bg)\", color: \"var(--dk-btn-text)\" }\n }\n onClick={onClick}\n disabled={disabled}\n >\n {children}\n </button>\n );\n};\n\nexport default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AA,CAAA,MAAA,CAChB;AACE,cAAE;cACA,0DAA0D,EAAA,GAAA,CAAA,CAAA,MAAA,CAC5D,SAAS,CAAE,EACf,KAAK,EACH;AACE,cAAE;cACA,EAAE,eAAe,EAAE,kBAAkB,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAE1E,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAAA,QAAA,EAEjB,QAAQ,EAAA,CACF;AAEb;;;;"}
1
+ {"version":3,"file":"Button.js","sources":["../../../../../src/components/ui/Button.tsx"],"sourcesContent":["/**\n * Button component - Unified adaptive button\n *\n * Adapts automatically between mobile and desktop using useIsMobile hook\n * rather than CSS responsive classes, for build compatibility.\n *\n * - Mobile: full width, tall (h-[48px], rounded-[12px])\n * - Desktop: auto width, comfortable (h-10, px-8, min-w-[140px])\n *\n * @param variant - \"primary\" (filled, default) | \"secondary\" (outlined)\n */\nimport useIsMobile from \"../../hooks/useIsMobile\";\n\ninterface ButtonProps {\n variant?: \"primary\" | \"secondary\";\n children: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n disabled?: boolean;\n type?: \"button\" | \"submit\" | \"reset\";\n}\n\nconst Button = ({\n variant = \"primary\",\n children,\n className = \"\",\n style,\n onClick,\n disabled = false,\n type = \"button\",\n}: ButtonProps) => {\n const isMobile = useIsMobile(768);\n\n const baseShared = \"flex items-center justify-center gap-2 shrink-0 font-poppins text-sm font-medium leading-[110%] transition-filter\";\n const base = isMobile\n ? `${baseShared} w-full h-[48px] rounded-[12px]`\n : `${baseShared} h-10 rounded-md px-8 min-w-[140px]`;\n\n if (variant === \"secondary\") {\n return (\n <button\n type={type}\n className={`${base} bg-transparent border border-gray-300 text-gray-600 ${\n disabled\n ? \"opacity-60 cursor-not-allowed\"\n : \"hover:bg-black/5 cursor-pointer\"\n } ${className}`}\n onClick={onClick}\n disabled={disabled}\n >\n {children}\n </button>\n );\n }\n\n return (\n <button\n type={type}\n className={`${base} ${\n disabled\n ? \"bg-gray-200 text-gray-400 cursor-not-allowed opacity-60\"\n : \"hover:brightness-110 active:brightness-90 cursor-pointer\"\n } ${className}`}\n style={\n disabled\n ? style\n : { ...style, backgroundColor: style?.backgroundColor ?? \"var(--dk-btn-bg)\", color: style?.color ?? \"var(--dk-btn-text)\" }\n }\n onClick={onClick}\n disabled={disabled}\n >\n {children}\n </button>\n );\n};\n\nexport default Button;\n"],"names":["useIsMobile","_jsx"],"mappings":";;;;;;;;AAuBA,IAAM,MAAM,GAAG,UAAC,EAQF,EAAA;;AAPZ,IAAA,IAAA,EAAA,GAAA,EAAA,CAAA,OAAmB,EAAnB,OAAO,GAAA,EAAA,KAAA,MAAA,GAAG,SAAS,KAAA,EACnB,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,iBAAc,EAAd,SAAS,GAAA,EAAA,KAAA,MAAA,GAAG,EAAE,KAAA,EACd,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,EAAA,GAAA,EAAA,CAAA,QAAgB,EAAhB,QAAQ,GAAA,EAAA,KAAA,MAAA,GAAG,KAAK,GAAA,EAAA,EAChB,EAAA,GAAA,EAAA,CAAA,IAAe,EAAf,IAAI,GAAA,EAAA,KAAA,MAAA,GAAG,QAAQ,GAAA,EAAA;AAEf,IAAA,IAAM,QAAQ,GAAGA,mBAAW,CAAC,GAAG,CAAC;IAEjC,IAAM,UAAU,GAAG,mHAAmH;IACtI,IAAM,IAAI,GAAG;UACT,EAAA,CAAA,MAAA,CAAG,UAAU,EAAA,iCAAA;AACf,UAAE,EAAA,CAAA,MAAA,CAAG,UAAU,EAAA,qCAAA,CAAqC;AAEtD,IAAA,IAAI,OAAO,KAAK,WAAW,EAAE;QAC3B,QACEC,cAAA,CAAA,QAAA,EAAA,EACE,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,EAAA,CAAA,MAAA,CAAG,IAAI,EAAA,uDAAA,CAAA,CAA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