@smileid/usesmileid 12.3.1-SNAPSHOT.65 → 12.3.1-SNAPSHOT.69

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 (153) hide show
  1. package/dist/{presentation/flow/dsl/builder/ml_builder.d.ts → bridge/dsl/use_smile_id_ml_builder.d.ts} +1 -1
  2. package/dist/bridge/dsl/use_smile_id_ml_builder.js +1 -0
  3. package/dist/camera/{camera_configuration.d.ts → core/camera_configuration.d.ts} +1 -1
  4. package/dist/camera/{camera_defaults.d.ts → core/camera_defaults.d.ts} +7 -1
  5. package/dist/camera/core/camera_defaults.js +1 -0
  6. package/dist/camera/{document_image_pipeline.d.ts → core/document_image_pipeline.d.ts} +1 -1
  7. package/dist/camera/{document_image_pipeline.js → core/document_image_pipeline.js} +1 -1
  8. package/dist/camera/core/imported_document_folder.js +1 -0
  9. package/dist/camera/{kamera_config_factory.d.ts → core/kamera_config_factory.d.ts} +1 -1
  10. package/dist/camera/core/kamera_config_factory.js +1 -0
  11. package/dist/camera/{kamera_error_mapping.d.ts → core/kamera_error_mapping.d.ts} +1 -1
  12. package/dist/camera/core/kamera_error_mapping.js +1 -0
  13. package/dist/camera/core/use_smile_id_frame_stream.js +1 -0
  14. package/dist/camera/core/use_smile_id_kamera_camera_system.js +1 -0
  15. package/dist/camera/{use_smile_id_kamera_preview.d.ts → ui/use_smile_id_kamera_preview.d.ts} +1 -1
  16. package/dist/camera/util/use_kamera_orientation.js +1 -0
  17. package/dist/core/exception/consent_denied_exception.d.ts +15 -0
  18. package/dist/core/exception/consent_denied_exception.js +1 -0
  19. package/dist/core/exception/flow_exceptions.d.ts +6 -48
  20. package/dist/core/exception/flow_exceptions.js +1 -1
  21. package/dist/core/exception/index.d.ts +5 -3
  22. package/dist/core/exception/index.js +1 -1
  23. package/dist/core/exception/navigation_failed_exception.d.ts +13 -0
  24. package/dist/core/exception/navigation_failed_exception.js +1 -0
  25. package/dist/core/exception/network_setup_exception.d.ts +11 -0
  26. package/dist/core/exception/network_setup_exception.js +1 -0
  27. package/dist/core/exception/processing_cancelled_exception.d.ts +14 -0
  28. package/dist/core/exception/processing_cancelled_exception.js +1 -0
  29. package/dist/core/models/config.d.ts +1 -1
  30. package/dist/data/compression/payload_compression_runner.d.ts +0 -6
  31. package/dist/data/compression/payload_compression_runner.js +1 -1
  32. package/dist/{core → data}/exception/missing_partner_config_exception.d.ts +1 -1
  33. package/dist/data/exception/missing_partner_config_exception.js +1 -0
  34. package/dist/data/factory/networking_factory.js +1 -1
  35. package/dist/data/model/sdk_config_capture.d.ts +8 -0
  36. package/dist/data/model/sdk_config_capture.js +1 -1
  37. package/dist/debug/document_preview_debug_geometry.js +1 -1
  38. package/dist/debug/selfie_preview_debug_geometry.d.ts +1 -1
  39. package/dist/debug/selfie_preview_debug_geometry.js +1 -1
  40. package/dist/debug/use_smile_id_selfie_preview_debug_overlay.js +1 -1
  41. package/dist/index.d.ts +19 -18
  42. package/dist/index.js +1 -1
  43. package/dist/metadata/metadata_configuration_mappers.js +1 -1
  44. package/dist/metadata/use_smile_id_metadata_factory.js +1 -1
  45. package/dist/presentation/components/captured_oval_region.js +1 -0
  46. package/dist/presentation/components/selfie_interior_crop.js +1 -0
  47. package/dist/presentation/components/use_smile_id_capture_content.d.ts +1 -1
  48. package/dist/presentation/components/use_smile_id_captured_document_image.js +1 -1
  49. package/dist/presentation/components/use_smile_id_captured_image_oval.d.ts +1 -1
  50. package/dist/presentation/components/use_smile_id_captured_image_oval.js +1 -1
  51. package/dist/presentation/components/use_smile_id_document_overlay.d.ts +1 -1
  52. package/dist/presentation/components/use_smile_id_document_shimmer.d.ts +1 -1
  53. package/dist/presentation/components/use_smile_id_face_overlay.js +1 -1
  54. package/dist/presentation/flow/{dsl/builder/config_builder.d.ts → config/use_smile_id_config_builder.d.ts} +2 -2
  55. package/dist/presentation/flow/config/use_smile_id_config_builder.js +1 -0
  56. package/dist/presentation/flow/dsl/{builder/screens_builder.d.ts → screen_builders.d.ts} +7 -7
  57. package/dist/presentation/flow/dsl/screen_builders.js +1 -0
  58. package/dist/presentation/flow/dsl/{builder/theme_builder.d.ts → theme_config_builder.d.ts} +1 -1
  59. package/dist/presentation/flow/dsl/theme_config_builder.js +1 -0
  60. package/dist/presentation/flow/dsl/use_smile_id_flow_builder.d.ts +6 -6
  61. package/dist/presentation/flow/dsl/use_smile_id_flow_builder.js +1 -1
  62. package/dist/presentation/flow/flow_navigation_graph.d.ts +7 -8
  63. package/dist/presentation/flow/flow_navigation_graph.js +1 -1
  64. package/dist/presentation/flow/flow_navigation_manager.d.ts +4 -4
  65. package/dist/presentation/flow/flow_navigation_manager.js +1 -1
  66. package/dist/presentation/flow/flow_navigation_manager_analytics.d.ts +1 -1
  67. package/dist/presentation/flow/flow_navigation_manager_routing.d.ts +1 -1
  68. package/dist/presentation/flow/graph/screen_renderer.d.ts +1 -1
  69. package/dist/presentation/flow/model/instructions_defaults.d.ts +1 -1
  70. package/dist/presentation/flow/{job_submission_state.d.ts → model/job_submission_state.d.ts} +1 -1
  71. package/dist/presentation/flow/screen/helpers/always_enabled_slot.d.ts +1 -1
  72. package/dist/presentation/flow/screen/orchestrated_capture_screen.d.ts +1 -1
  73. package/dist/presentation/flow/screen/orchestrated_capture_screen.js +1 -1
  74. package/dist/presentation/flow/screen/orchestrated_consent_screen.d.ts +1 -1
  75. package/dist/presentation/flow/screen/orchestrated_consent_screen.js +1 -1
  76. package/dist/presentation/flow/screen/orchestrated_instructions_screen.d.ts +1 -1
  77. package/dist/presentation/flow/screen/orchestrated_instructions_screen.js +1 -1
  78. package/dist/presentation/flow/screen/orchestrated_partner_screen.d.ts +1 -1
  79. package/dist/presentation/flow/screen/orchestrated_preview_screen.d.ts +1 -1
  80. package/dist/presentation/flow/screen/orchestrated_preview_screen.js +1 -1
  81. package/dist/presentation/flow/screen/orchestrated_processing_screen.d.ts +1 -1
  82. package/dist/presentation/flow/use_smile_id_flow.js +1 -1
  83. package/dist/presentation/flow/validation/flow_validator.d.ts +1 -1
  84. package/dist/presentation/flow/validation/job_type_validator.d.ts +1 -1
  85. package/dist/presentation/flow/validation/job_type_validator.js +1 -1
  86. package/dist/presentation/flow/validation/partner_screen_validation.d.ts +1 -1
  87. package/dist/presentation/screen/helpers/instructions_screen_helpers.d.ts +1 -1
  88. package/dist/presentation/screen/helpers/instructions_screen_helpers.js +1 -1
  89. package/dist/presentation/screen/helpers/use_capture_orientation_lock.d.ts +1 -1
  90. package/dist/presentation/screen/use_smile_id_capture_screen.d.ts +4 -4
  91. package/dist/presentation/screen/use_smile_id_capture_screen.js +1 -1
  92. package/dist/presentation/screen/use_smile_id_consent_screen.d.ts +3 -3
  93. package/dist/presentation/screen/use_smile_id_consent_screen.js +1 -1
  94. package/dist/presentation/screen/use_smile_id_document_preview_screen.js +1 -1
  95. package/dist/presentation/screen/use_smile_id_preview_screen.d.ts +1 -1
  96. package/dist/presentation/screen/use_smile_id_processing_screen.d.ts +1 -1
  97. package/dist/presentation/screen/use_smile_id_processing_screen.js +1 -1
  98. package/dist/presentation/utils/locale_utils.d.ts +8 -19
  99. package/dist/presentation/utils/locale_utils.js +1 -1
  100. package/dist/testing/index.d.ts +1 -1
  101. package/dist/testing/index.js +1 -1
  102. package/package.json +5 -5
  103. package/dist/camera/camera_defaults.js +0 -1
  104. package/dist/camera/imported_document_folder.js +0 -1
  105. package/dist/camera/kamera_config_factory.js +0 -1
  106. package/dist/camera/kamera_error_mapping.js +0 -1
  107. package/dist/camera/use_kamera_orientation.js +0 -1
  108. package/dist/camera/use_smile_id_frame_stream.js +0 -1
  109. package/dist/camera/use_smile_id_kamera_camera_system.js +0 -1
  110. package/dist/core/exception/missing_partner_config_exception.js +0 -1
  111. package/dist/presentation/components/helpers/captured_oval_region.js +0 -1
  112. package/dist/presentation/components/helpers/selfie_interior_crop.js +0 -1
  113. package/dist/presentation/flow/dsl/builder/config_builder.js +0 -1
  114. package/dist/presentation/flow/dsl/builder/ml_builder.js +0 -1
  115. package/dist/presentation/flow/dsl/builder/screens_builder.js +0 -1
  116. package/dist/presentation/flow/dsl/builder/theme_builder.js +0 -1
  117. /package/dist/{core/models → bridge/model}/head_turn_direction.d.ts +0 -0
  118. /package/dist/{core/models → bridge/model}/head_turn_direction.js +0 -0
  119. /package/dist/camera/{bounding_box_metering_region.d.ts → core/bounding_box_metering_region.d.ts} +0 -0
  120. /package/dist/camera/{bounding_box_metering_region.js → core/bounding_box_metering_region.js} +0 -0
  121. /package/dist/camera/{camera_configuration.js → core/camera_configuration.js} +0 -0
  122. /package/dist/camera/{camera_lens.d.ts → core/camera_lens.d.ts} +0 -0
  123. /package/dist/camera/{camera_lens.js → core/camera_lens.js} +0 -0
  124. /package/dist/camera/{device_tilt_override.d.ts → core/device_tilt_override.d.ts} +0 -0
  125. /package/dist/camera/{device_tilt_override.js → core/device_tilt_override.js} +0 -0
  126. /package/dist/camera/{document_resize_target.d.ts → core/document_resize_target.d.ts} +0 -0
  127. /package/dist/camera/{document_resize_target.js → core/document_resize_target.js} +0 -0
  128. /package/dist/camera/{focus_state.d.ts → core/focus_state.d.ts} +0 -0
  129. /package/dist/camera/{focus_state.js → core/focus_state.js} +0 -0
  130. /package/dist/camera/{imported_document_folder.d.ts → core/imported_document_folder.d.ts} +0 -0
  131. /package/dist/camera/{use_smile_id_frame_stream.d.ts → core/use_smile_id_frame_stream.d.ts} +0 -0
  132. /package/dist/camera/{use_smile_id_kamera_camera_system.d.ts → core/use_smile_id_kamera_camera_system.d.ts} +0 -0
  133. /package/dist/camera/{view_mirrors_frames.d.ts → core/view_mirrors_frames.d.ts} +0 -0
  134. /package/dist/camera/{view_mirrors_frames.js → core/view_mirrors_frames.js} +0 -0
  135. /package/dist/camera/{use_smile_id_kamera_preview.js → ui/use_smile_id_kamera_preview.js} +0 -0
  136. /package/dist/camera/{camera_permissions.d.ts → util/camera_permissions.d.ts} +0 -0
  137. /package/dist/camera/{camera_permissions.js → util/camera_permissions.js} +0 -0
  138. /package/dist/camera/{use_kamera_camera_permission.d.ts → util/use_kamera_camera_permission.d.ts} +0 -0
  139. /package/dist/camera/{use_kamera_camera_permission.js → util/use_kamera_camera_permission.js} +0 -0
  140. /package/dist/camera/{use_kamera_orientation.d.ts → util/use_kamera_orientation.d.ts} +0 -0
  141. /package/dist/presentation/components/{helpers/captured_oval_region.d.ts → captured_oval_region.d.ts} +0 -0
  142. /package/dist/presentation/components/{helpers/document_interior_crop.d.ts → document_interior_crop.d.ts} +0 -0
  143. /package/dist/presentation/components/{helpers/document_interior_crop.js → document_interior_crop.js} +0 -0
  144. /package/dist/presentation/components/{helpers/selfie_interior_crop.d.ts → selfie_interior_crop.d.ts} +0 -0
  145. /package/dist/{core/models → presentation/flow/config}/document_capture_mode.d.ts +0 -0
  146. /package/dist/{core/models → presentation/flow/config}/document_capture_mode.js +0 -0
  147. /package/dist/{core/models → presentation/flow/config}/document_type.d.ts +0 -0
  148. /package/dist/{core/models → presentation/flow/config}/document_type.js +0 -0
  149. /package/dist/{core/models → presentation/flow/config}/global_privacy_control.d.ts +0 -0
  150. /package/dist/{core/models → presentation/flow/config}/global_privacy_control.js +0 -0
  151. /package/dist/presentation/flow/{dsl/builder → config}/partner_value_format.d.ts +0 -0
  152. /package/dist/presentation/flow/{dsl/builder → config}/partner_value_format.js +0 -0
  153. /package/dist/presentation/flow/{job_submission_state.js → model/job_submission_state.js} +0 -0
@@ -1,6 +1,6 @@
1
1
  import type { FaceAnalyzer, DocumentAnalyzer } from "@smileid/usesmileid_platform_interface";
2
2
  import { type FaceConfig, type FaceDetectorConfig, type FaceDetectorMode } from "@smileid/usesmileid_bridge";
3
- import { CaptureType, type AnalyzerRegistry, type MLConfig } from "../../../../core/models/ml_config";
3
+ import { CaptureType, type AnalyzerRegistry, type MLConfig } from "../../core/models/ml_config";
4
4
  /**
5
5
  * `b.ml((m) => { m.analyzers((a) => { a.forCaptureType(CaptureType.selfie, (face) => face.add(useSmileIDVisionFace)); }); })`
6
6
  *
@@ -0,0 +1 @@
1
+ "use strict";import{FaceCaptureDefaults as a}from"@smileid/usesmileid_bridge";import{CaptureType as l}from"../../core/models/ml_config";export class FaceAnalyzerScope{add(n){this._analyzer=n}_analyzer;detectorMode="default";faceDetectorConfig;toFaceConfig(){const n=this._analyzer;if(!n)return;const e=this.faceDetectorConfig;return{numSamples:a.numSamples,faceDetectorMode:this.detectorMode,...e?.minFillThreshold!==void 0?{minFillThreshold:e.minFillThreshold}:{},...e?.maxFillThreshold!==void 0?{maxFillThreshold:e.maxFillThreshold}:{},...e?.faceDetectorMinScore!==void 0?{faceDetectorMinScore:e.faceDetectorMinScore}:{},...e?.centerToleranceX!==void 0?{centerToleranceX:e.centerToleranceX}:{},...e?.centerToleranceY!==void 0?{centerToleranceY:e.centerToleranceY}:{},...e?.motionBlurMinIou!==void 0?{motionBlurMinIou:e.motionBlurMinIou}:{},...e?.motionBlurMinDuration!==void 0?{motionBlurMinDuration:e.motionBlurMinDuration}:{},...e?.minTopPadding!==void 0?{minTopPadding:e.minTopPadding}:{},...e?.minFaceBoundsThreshold!==void 0?{minFaceBoundsThreshold:e.minFaceBoundsThreshold}:{},...e?.maxFaceBoundsThreshold!==void 0?{maxFaceBoundsThreshold:e.maxFaceBoundsThreshold}:{},...e?.minSmileProbability!==void 0?{minSmileProbability:e.minSmileProbability}:{},analyzerFactoryKey:n.key}}}export class DocumentAnalyzerScope{add(n){this._analyzer=n}_analyzer}export class AnalyzerRegistryBuilder{_selfie;_selfieConfig;_document;forCaptureType(n,e){if(n===l.selfie){const i=new FaceAnalyzerScope;e(i),i._analyzer&&(this._selfie=i._analyzer,this._selfieConfig=i.toFaceConfig());return}const o=new DocumentAnalyzerScope;e(o),o._analyzer&&(this._document=o._analyzer)}build(){return Object.freeze({...this._selfie?{selfie:this._selfie}:{},...this._selfieConfig?{selfieConfig:this._selfieConfig}:{},...this._document?{document:this._document}:{}})}}export class UseSmileIDMLBuilder{_analyzers;analyzers(n){this._analyzers||(this._analyzers=new AnalyzerRegistryBuilder),n(this._analyzers)}build(){return Object.freeze({analyzers:this._analyzers?this._analyzers.build():Object.freeze({})})}}
@@ -1,5 +1,5 @@
1
1
  import type { CameraLens } from "./camera_lens";
2
- import type { CaptureType } from "../core/models/ml_config";
2
+ import type { CaptureType } from "../../core/models/ml_config";
3
3
  /**
4
4
  * Camera-system configuration applied when the orchestrator starts.
5
5
  * All fields optional — see `CameraDefaults` for the values applied
@@ -18,7 +18,13 @@ export declare const CameraDefaults: {
18
18
  };
19
19
  /** Longest-edge ceiling (px) for an imported document image; downscale-only. */
20
20
  readonly documentMaxDimension: 1600;
21
- /** JPEG quality (0–1) for imported document images. */
21
+ /** JPEG quality (0–1) a selfie falls back to when the token carries none. */
22
+ readonly jpegQualityForSelfie: 0.95;
23
+ /** JPEG quality (0–1) a liveness frame falls back to when the token carries none. */
24
+ readonly jpegQualityForLiveness: 0.8;
25
+ /** JPEG quality (0–1) for a document, captured or imported, when the token carries none. */
26
+ readonly jpegQualityForDocument: 0.85;
27
+ /** @deprecated Use {@link CameraDefaults.jpegQualityForDocument}. */
22
28
  readonly documentJpegQuality: 0.85;
23
29
  /** Minimum shortest-edge (px) for a gallery document image; smaller is rejected. */
24
30
  readonly minGalleryDocumentDimensionPx: 600;
@@ -0,0 +1 @@
1
+ "use strict";const e=.85;export const CameraDefaults={focusRunningDurationMs:600,focusSettledDurationMs:500,analysisTargetFps:30,analysisTargetResolution:{width:640,height:480},documentAnalysisResolution:{width:1280,height:720},documentMaxDimension:1600,jpegQualityForSelfie:.95,jpegQualityForLiveness:.8,jpegQualityForDocument:.85,documentJpegQuality:.85,minGalleryDocumentDimensionPx:600,selfieJpegTargetWidth:480,selfieJpegTargetHeight:640};
@@ -4,7 +4,7 @@ export { computeDocumentResizeTarget } from "./document_resize_target";
4
4
  * Imported document image pipeline — brings a manual-shutter still or gallery
5
5
  * image onto the SAME byte policy as the native auto-capture artifact: longest
6
6
  * edge downscaled to {@link CameraDefaults.documentMaxDimension} at
7
- * {@link CameraDefaults.documentJpegQuality}, written under the canonical
7
+ * {@link CameraDefaults.jpegQualityForDocument}, written under the canonical
8
8
  * per-side filename. The Smile EXIF `UserComment` tag is stamped downstream by
9
9
  * `SmileExifTagger.finalize`, so every upload is byte-policy-identical
10
10
  * regardless of capture path.
@@ -1 +1 @@
1
- "use strict";import{File as i}from"expo-file-system";import{ImageManipulator as m,SaveFormat as s}from"expo-image-manipulator";import{DocumentSide as o,UseSmileIDCrashReporting as u}from"@smileid/usesmileid_bridge";import{CameraDefaults as a}from"./camera_defaults";import{computeDocumentResizeTarget as d}from"./document_resize_target";import{newImportedDocumentFolder as p}from"./imported_document_folder";export{computeDocumentResizeTarget}from"./document_resize_target";export function documentArtifactFileName(t){switch(t){case o.Back:return"document_back.jpg";case o.Visa:return"document_visa.jpg";default:return"document_front.jpg"}}export async function resampleImportedDocument(t,n){const r=t.width!==void 0&&t.height!==void 0?d(t.width,t.height,a.documentMaxDimension):null,e=m.manipulate(t.uri);r&&e.resize(r);const c=await(await e.renderAsync()).saveAsync({compress:a.documentJpegQuality,format:s.JPEG});return f(c.uri,n)}function f(t,n){const r=p();try{r.exists||r.create({intermediates:!0});const e=new i(r,documentArtifactFileName(n));return e.exists&&e.delete(),new i(t).move(e),e.uri}catch(e){u.captureException(e instanceof Error?e:new Error(String(e)));try{r.exists&&r.delete()}catch{}return t}}
1
+ "use strict";import{File as o}from"expo-file-system";import{ImageManipulator as m,SaveFormat as s}from"expo-image-manipulator";import{DocumentSide as i,UseSmileIDCrashReporting as u}from"@smileid/usesmileid_bridge";import{CameraDefaults as a}from"./camera_defaults";import{computeDocumentResizeTarget as d}from"./document_resize_target";import{newImportedDocumentFolder as p}from"./imported_document_folder";export{computeDocumentResizeTarget}from"./document_resize_target";export function documentArtifactFileName(t){switch(t){case i.Back:return"document_back.jpg";case i.Visa:return"document_visa.jpg";default:return"document_front.jpg"}}export async function resampleImportedDocument(t,n){const r=t.width!==void 0&&t.height!==void 0?d(t.width,t.height,a.documentMaxDimension):null,e=m.manipulate(t.uri);r&&e.resize(r);const c=await(await e.renderAsync()).saveAsync({compress:a.jpegQualityForDocument,format:s.JPEG});return f(c.uri,n)}function f(t,n){const r=p();try{r.exists||r.create({intermediates:!0});const e=new o(r,documentArtifactFileName(n));return e.exists&&e.delete(),new o(t).move(e),e.uri}catch(e){u.captureException(e instanceof Error?e:new Error(String(e)));try{r.exists&&r.delete()}catch{}return t}}
@@ -0,0 +1 @@
1
+ "use strict";import{Directory as r,File as c,Paths as u}from"expo-file-system";import{generateSessionId as s}from"../../metadata/use_smile_id_metadata_factory";export const IMPORT_SUBDIRECTORY="usesmileid_documents";export function newImportedDocumentFolder(){return new r(o(),s())}function o(){return new r(u.cache,IMPORT_SUBDIRECTORY)}function n(e){return e.replace(/\/+$/,"")}export function deleteImportedDocument(e){try{const t=new c(e).parentDirectory,i=n(o().uri);if(n(t.parentDirectory.uri)!==i)return;t.exists&&t.delete()}catch{}}
@@ -1,5 +1,5 @@
1
1
  import type { KameraConfig, Lens } from "@smileid/kamera";
2
- import { CaptureType } from "../core/models/ml_config";
2
+ import { CaptureType } from "../../core/models/ml_config";
3
3
  import { CameraLens } from "./camera_lens";
4
4
  /**
5
5
  * The selfie's analysis interval: 30 frames a second, which its 0.2 s
@@ -0,0 +1 @@
1
+ "use strict";import{Platform as n}from"react-native";import{KameraDefaults as o}from"@smileid/kamera";import{CaptureType as m}from"../../core/models/ml_config";import{CameraLens as i}from"./camera_lens";export const SELFIE_ANALYSIS_INTERVAL_MS=33,KameraConfigFactory={create(e,a){const r=toKameraLens(a);if(e===m.document)return o.document(r);const t=o.selfie(r);return{...t,analysis:{...t.analysis,minIntervalMs:SELFIE_ANALYSIS_INTERVAL_MS,deviceMotion:!0,...n.OS==="ios"?{faceTracking:!0}:{}}}}};export function toKameraLens(e){return e===i.back?"back":"front"}
@@ -1,4 +1,4 @@
1
- import { UseSmileIDCameraSurfaceException } from "../core/exception/use_smile_id_camera_surface_exception";
1
+ import { UseSmileIDCameraSurfaceException } from "../../core/exception/use_smile_id_camera_surface_exception";
2
2
  /**
3
3
  * Maps a kamera error code to a categorised {@link UseSmileIDCameraSurfaceException}.
4
4
  * Unknown codes fall through to the generic camera code so a new engine error still surfaces.
@@ -0,0 +1 @@
1
+ "use strict";import{UseSmileIDCameraSurfaceException as o}from"../../core/exception/use_smile_id_camera_surface_exception";import{UseSmileIDErrorCode as e}from"../../core/exception/use_smile_id_error_code";export function cameraExceptionFromKameraError(r,t){const{errorCode:a,suggestedFix:s}=i[r]??{errorCode:e.Camera.Unknown,suggestedFix:"Retry the capture; if it persists, restart the camera flow."};return new o({errorCode:a,message:t??`Camera session error: ${r}`,suggestedFix:s,errorDetails:{kameraCode:r}})}export function isTerminalKameraError(r){return r!=="sessionInterrupted"}const i={permissionDenied:{errorCode:e.Camera.PermissionDenied,suggestedFix:"Grant camera access in Settings, then start the capture again."},cameraInUse:{errorCode:e.Camera.InitializationFailed,suggestedFix:"Close other apps using the camera, then retry."},configurationUnsupported:{errorCode:e.Camera.UseCaseNotSupported,suggestedFix:"This device does not support the requested capture mode."},captureFailed:{errorCode:e.Camera.CaptureFailed,suggestedFix:"Retry the capture."},sessionInterrupted:{errorCode:e.Camera.Unknown,suggestedFix:"The camera was interrupted; start the capture again."}};
@@ -0,0 +1 @@
1
+ "use strict";import{useCallback as E,useEffect as s,useMemo as S,useRef as f}from"react";import{documentScanResultSchema as F,faceScanResultSchema as h,FrameProcessingException as g}from"@smileid/usesmileid_bridge";import{isDevelopmentBuild as p}from"../../core/is_development_build";import{UseSmileIDDebugTap as d}from"../../debug/use_smile_id_debug_tap";export function useSmileIDFrameStream(e,t,u){const m=f(e),c=f(t),o=f(u?.onError),i=f(!1),a=f(!0);s(()=>{m.current=e},[e]),s(()=>{if(!p()||e?.kind!=="face")return;const r=e.takeCameraFrames;if(r)return d.countCameraFramesWith(()=>r.call(e))},[e]),s(()=>{if(!p()||e?.kind!=="face")return;const r=e.setFaceLumaSampling;if(r)return d.sampleFaceLumaWith(l=>r.call(e,l))},[e]),s(()=>{c.current=t},[t]),s(()=>{o.current=u?.onError},[u?.onError]),s(()=>(a.current=!0,()=>{a.current=!1}),[]);const n=E(r=>{const l=o.current;dispatchFrameResult({raw:r,analyzer:m.current,isBusy:()=>i.current,setBusy:R=>{i.current=R},isMounted:()=>a.current,onResult:c.current,...l!==void 0?{onError:l}:{}})},[]);return S(()=>({onFrameResult:n}),[n])}function k(e){if(e===null||typeof e!="object")return null;const t=e.error;return typeof t=="string"?t:null}const B=new Set(["no_frame","session_not_configured"]);export function dispatchFrameResult(e){const{raw:t,analyzer:u,isBusy:m,setBusy:c,isMounted:o,onResult:i,onError:a}=e;if(u&&!m()){c(!0);try{const n=k(t);if(n!==null){if(B.has(n))return;throw new g({reason:n})}if(u.kind==="face"){const r=h.parse(t);if(!o())return;i(r),p()&&d.analyzedFace(r.output)}else{const r=F.parse(t);if(!o())return;i(r),p()&&d.analyzedDocument(r.output)}}catch(n){if(!o())return;a?.(n)}finally{c(!1)}}}
@@ -0,0 +1 @@
1
+ "use strict";import{AspectRatio as f,KameraSession as p}from"@smileid/kamera";import{UseSmileIDCrashReporting as l}from"@smileid/usesmileid_bridge";import{Platform as S}from"react-native";import{CaptureType as c}from"../../core/models/ml_config";import{viewMirrorsFrames as g}from"./view_mirrors_frames";import{meteringRegion as w}from"./bounding_box_metering_region";import{CameraDefaults as h}from"./camera_defaults";import{CameraLens as a}from"./camera_lens";import{FocusStates as n}from"./focus_state";import{KameraConfigFactory as _}from"./kamera_config_factory";let m=!1,o=null;export function setKameraMetricsWanted(i){m=i}async function y(i){const e=m;if(e===o)return;o=e;const t=Promise.resolve().then(()=>i.setMetricsEnabled?.(e)).catch(s=>{o=null,l.captureException(s instanceof Error?s:new Error(String(s)))});e&&await t}export function resetKameraMetricsForTesting(){m=!1,o=null}export class UseSmileIDKameraCameraSystem{_createSession;_session=null;_removeEventListener=null;_state;_focusState=n.unspecified();_listeners=new Set;_eventListeners=new Set;_capabilities=null;_config={};_released=!1;_focusRunningTimeout=null;_focusSettledTimeout=null;constructor(e=a.front,t=()=>new p){this._createSession=t,this._state={isCameraRunning:!1,isStreaming:!1,currentLens:e,hasPermission:!1}}get state(){return this._state}get focusState(){return this._focusState}get capabilities(){return this._capabilities}get uprightPreviewAspect(){const e=this._config.captureType??c.selfie;return _.create(e,this._state.currentLens).preview.aspectRatio===f.Ratio16x9?9/16:3/4}get session(){return this._session}subscribe(e){return this._listeners.add(e),()=>this._listeners.delete(e)}addEventListener(e){return this._eventListeners.add(e),()=>this._eventListeners.delete(e)}configure(e){this._config=e,e.lens&&e.lens!==this._state.currentLens&&this._setState({...this._state,currentLens:e.lens})}async start(){if(this._released)throw new Error("UseSmileIDKameraCameraSystem.start() after release() \u2014 create a new system.");await this._teardownSession();const e=this._createSession(),t=e.addEventListener(u=>this._onKameraEvent(u)),s=this._config.captureType??c.selfie,r=this._config.lens??(s===c.document?a.back:a.front);try{await y(e),await e.start(_.create(s,r)),this._capabilities=await e.capabilities()}catch(u){throw t(),await e.release(),u}this._removeEventListener=t,this._session=e,this._documentGuideApplied=this._documentGuide===null,await this._applyDocumentGuide(),this._setState({...this._state,isCameraRunning:!0,isStreaming:!0,currentLens:r,hasPermission:!0})}async stop(){await this._session?.stop(),this._setState({...this._state,isCameraRunning:!1,isStreaming:!1})}async capture(){const e=this._session;if(!e)throw new Error("Cannot capture: camera is not initialised.");return e.capture()}async setZoomRatio(e){const t=this._session;if(!t)return;const s=this._capabilities,r=s?Math.min(s.maxZoomRatio,Math.max(s.minZoomRatio,e)):e;await t.setZoomRatio(r)}_documentGuide=null;_documentGuideApplied=!0;_documentGuideSendingTo=null;_documentGuideFailureReported=!1;async setDocumentGuide(e){d(e,this._documentGuide)||(this._documentGuide=e,this._documentGuideApplied=!1),await this._applyDocumentGuide()}async _applyDocumentGuide(){const e=this._session;if(!(e===null||this._documentGuideApplied||this._documentGuideSendingTo===e)){this._documentGuideSendingTo=e;try{for(;!this._documentGuideApplied&&this._session===e;){const t=this._documentGuide;if(!await this._sendDocumentGuide(e,t))return;this._session===e&&d(t,this._documentGuide)&&(this._documentGuideApplied=!0)}}finally{this._documentGuideSendingTo===e&&(this._documentGuideSendingTo=null)}}}async _sendDocumentGuide(e,t){try{return await e.setDocumentGuide?.(t?.widthMm??0,t?.frameWidthFraction??0),!0}catch(s){return this._documentGuideFailureReported||(this._documentGuideFailureReported=!0,l.captureException(s instanceof Error?s:new Error(String(s)))),!1}}async setTorch(e){await this._session?.setTorch(e)}async tapToFocus(e){const t=this._session;t&&(this._clearFocusTimers(),this._setFocusState(n.running(e)),t.tapToFocus(e.x,e.y).catch(()=>{this._clearFocusTimers(),this._setFocusState(n.unspecified())}),this._focusRunningTimeout=setTimeout(()=>{this._setFocusState(n.success(e)),this._focusSettledTimeout=setTimeout(()=>{this._setFocusState(n.unspecified())},h.focusSettledDurationMs)},h.focusRunningDurationMs))}meterExposure(e){const t=this._session;if(!t)return;const s=e?w(e,g(this._state.currentLens===a.front,S.OS==="android")):null;t.setMeteringRegion?.(s).catch(()=>{})}async release(){this._released=!0,this._clearFocusTimers(),await this._teardownSession(),this._setState({...this._state,isCameraRunning:!1,isStreaming:!1})}_onKameraEvent(e){for(const t of[...this._eventListeners])t(e);e.type==="error"&&this._setState({...this._state,isStreaming:!1})}async _teardownSession(){this._removeEventListener?.(),this._removeEventListener=null;const e=this._session;this._session=null,this._capabilities=null,e&&await e.release()}_clearFocusTimers(){this._focusRunningTimeout&&clearTimeout(this._focusRunningTimeout),this._focusSettledTimeout&&clearTimeout(this._focusSettledTimeout),this._focusRunningTimeout=null,this._focusSettledTimeout=null}_setState(e){this._state=e,this._notify()}_setFocusState(e){this._focusState=e,this._notify()}_notify(){for(const e of[...this._listeners])e(this._state,this._focusState)}}function d(i,e){return i?.widthMm===e?.widthMm&&i?.frameWidthFraction===e?.frameWidthFraction}
@@ -1,5 +1,5 @@
1
1
  import { type StyleProp, type ViewStyle } from "react-native";
2
- import type { UseSmileIDKameraCameraSystem } from "./use_smile_id_kamera_camera_system";
2
+ import type { UseSmileIDKameraCameraSystem } from "../core/use_smile_id_kamera_camera_system";
3
3
  export type UseSmileIDKameraPreviewProps = {
4
4
  readonly cameraSystem: UseSmileIDKameraCameraSystem;
5
5
  readonly style?: StyleProp<ViewStyle>;
@@ -0,0 +1 @@
1
+ "use strict";import{useEffect as A,useState as D}from"react";import{Platform as I}from"react-native";import*as n from"expo-screen-orientation";import{loadExpoSensors as S}from"../../metadata/optional_native_modules";import{deviceTiltOverride as v}from"../core/device_tilt_override";const T=2;export const FLAT_TILT_DEGREES=90;const L=-1;export function useDeviceTiltDegrees(u){const r=u?.retainWhenFlat??!1,i=useLockedInterfaceOrientationDegrees(),[s,a]=D(null);return A(()=>{const e=S();if(!e)return;e.Accelerometer.setUpdateInterval(200);let o=null,t=0;const p=e.Accelerometer.addListener(({x:E,y:h})=>{const f=I.OS==="android"?-1:1,l=E*f,d=h*f,g=Math.abs(l),m=Math.abs(d);if(g<.5&&m<.5){if(r){o=null,t=0;return}t=o===L?t+1:1,o=L,t>=T&&a(FLAT_TILT_DEGREES);return}const c=g>m?l>0?270:90:d>0?180:0;t=c===o?t+1:1,o=c,!(t<T)&&a(O=>O===c?O:c)});return()=>p.remove()},[r]),v()??s??i}export function useLockedInterfaceOrientationDegrees(){const[u,r]=D(0);return A(()=>{let i=!0;const s=e=>{switch(e){case n.Orientation.LANDSCAPE_LEFT:return 90;case n.Orientation.LANDSCAPE_RIGHT:return 270;case n.Orientation.PORTRAIT_DOWN:return 180;default:return 0}};n.getOrientationAsync().then(e=>{i&&r(s(e))}).catch(()=>{});const a=n.addOrientationChangeListener(e=>{r(s(e.orientationInfo.orientation))});return()=>{i=!1,n.removeOrientationChangeListener(a)}},[]),u}
@@ -0,0 +1,15 @@
1
+ import { UseSmileIDGeneralException } from "./use_smile_id_general_exception";
2
+ /**
3
+ * The user declined the consent notice on the consent screen.
4
+ *
5
+ * Surfaced through `onResult.failure` so partners can distinguish a
6
+ * deliberate consent denial from other flow failures. Carries the
7
+ * wall-clock `timestamp` (epoch ms) of the denial, mirroring the
8
+ * native SDKs' `ConsentDeniedException`.
9
+ */
10
+ export declare class ConsentDeniedException extends UseSmileIDGeneralException {
11
+ readonly errorCode: "GENERAL_OPERATION_FAILED";
12
+ constructor(args: {
13
+ timestamp: number;
14
+ });
15
+ }
@@ -0,0 +1 @@
1
+ "use strict";import{UseSmileIDErrorCode as r}from"./use_smile_id_error_code";import{UseSmileIDGeneralException as t}from"./use_smile_id_general_exception";export class ConsentDeniedException extends t{errorCode=r.General.OperationFailed;constructor(e){super({message:"User denied consent",suggestedFix:"The user declined the consent notice; no further action is required.",errorDetails:{timestamp:e.timestamp}})}}
@@ -1,50 +1,8 @@
1
- import { UseSmileIDGeneralException } from "./use_smile_id_general_exception";
2
1
  /**
3
- * The user declined the consent notice on the consent screen.
4
- *
5
- * Surfaced through `onResult.failure` so partners can distinguish a
6
- * deliberate consent denial from other flow failures. Carries the
7
- * wall-clock `timestamp` (epoch ms) of the denial, mirroring the
8
- * native SDKs' `ConsentDeniedException`.
2
+ * Re-export barrel for the flow-control exceptions. Each concrete class
3
+ * lives in its own file; this module keeps the legacy import path stable.
9
4
  */
10
- export declare class ConsentDeniedException extends UseSmileIDGeneralException {
11
- readonly errorCode: "GENERAL_OPERATION_FAILED";
12
- constructor(args: {
13
- timestamp: number;
14
- });
15
- }
16
- /**
17
- * The user exited the processing screen before submission completed.
18
- *
19
- * Surfaced through `onResult.failure` so partners can distinguish a
20
- * user-initiated cancellation from a submission error, mirroring the
21
- * native SDKs' `ProcessingCancelledException`. An optional `cause` carries a submission failure that preceded the exit.
22
- */
23
- export declare class ProcessingCancelledException extends UseSmileIDGeneralException {
24
- readonly errorCode: "GENERAL_OPERATION_FAILED";
25
- constructor(args?: {
26
- cause?: unknown;
27
- });
28
- }
29
- /**
30
- * The flow's navigation failed: njia refused to start the flow's engine, or a
31
- * call to it failed. Surfaced through `onResult.failure` with
32
- * `GENERAL_INVALID_STATE` and njia's error as its `cause`, as the native SDKs
33
- * surface it through their general exception.
34
- */
35
- export declare class NavigationFailedException extends UseSmileIDGeneralException {
36
- readonly errorCode: "GENERAL_INVALID_STATE";
37
- constructor(args: {
38
- cause: unknown;
39
- });
40
- }
41
- /**
42
- * The flow's native network client couldn't be set up, so the flow ends at start rather than run
43
- * with no network. Surfaced through `onResult.failure`; `cause` says why.
44
- */
45
- export declare class NetworkSetupException extends UseSmileIDGeneralException {
46
- readonly errorCode: "GENERAL_OPERATION_FAILED";
47
- constructor(args: {
48
- cause: unknown;
49
- });
50
- }
5
+ export { ConsentDeniedException } from "./consent_denied_exception";
6
+ export { NavigationFailedException } from "./navigation_failed_exception";
7
+ export { NetworkSetupException } from "./network_setup_exception";
8
+ export { ProcessingCancelledException } from "./processing_cancelled_exception";
@@ -1 +1 @@
1
- "use strict";import{UseSmileIDErrorCode as s}from"./use_smile_id_error_code";import{UseSmileIDGeneralException as t}from"./use_smile_id_general_exception";export class ConsentDeniedException extends t{errorCode=s.General.OperationFailed;constructor(e){super({message:"User denied consent",suggestedFix:"The user declined the consent notice; no further action is required.",errorDetails:{timestamp:e.timestamp}})}}export class ProcessingCancelledException extends t{errorCode=s.General.OperationFailed;constructor(e={}){super({message:"Processing was cancelled",suggestedFix:"The user exited the processing screen before submission completed.",...e.cause!==void 0?{cause:e.cause}:{}})}}export class NavigationFailedException extends t{errorCode=s.General.InvalidState;constructor(e){super({message:`The flow's navigation failed: ${e.cause instanceof Error?e.cause.message:String(e.cause)}`,suggestedFix:"Contact Smile ID support if the issue persists.",cause:e.cause})}}export class NetworkSetupException extends t{errorCode=s.General.OperationFailed;constructor(e){super({message:"The flow's network client couldn't be set up",suggestedFix:"Check the cause. A missing or outdated native module needs @smileid/usesmileid_bridge at the SDK's version and a rebuild of the app's native code.",cause:e.cause})}}
1
+ "use strict";export{ConsentDeniedException}from"./consent_denied_exception";export{NavigationFailedException}from"./navigation_failed_exception";export{NetworkSetupException}from"./network_setup_exception";export{ProcessingCancelledException}from"./processing_cancelled_exception";
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * The legacy cluster files (`screen_config_validation_exceptions.ts`,
8
8
  * `capture_validation_exceptions.ts`, `consent_validation_exceptions.ts`,
9
- * `job_validation_exceptions.ts`) continue to re-export their original
9
+ * `job_validation_exceptions.ts`, `flow_exceptions.ts`) continue to re-export their original
10
10
  * class lists so partner code that deep-imports them keeps compiling.
11
11
  */
12
12
  export { IssueSeverity } from "./issue_severity";
@@ -20,7 +20,10 @@ export { UseSmileIDNetworkException } from "./use_smile_id_network_exception";
20
20
  export { UseSmileIDAttestationException } from "./use_smile_id_attestation_exception";
21
21
  export { UseSmileIDGeneralException } from "./use_smile_id_general_exception";
22
22
  export { BuilderValidationException } from "./builder_validation_exception";
23
- export { ConsentDeniedException, NavigationFailedException, ProcessingCancelledException, NetworkSetupException, } from "./flow_exceptions";
23
+ export { ConsentDeniedException } from "./consent_denied_exception";
24
+ export { NavigationFailedException } from "./navigation_failed_exception";
25
+ export { ProcessingCancelledException } from "./processing_cancelled_exception";
26
+ export { NetworkSetupException } from "./network_setup_exception";
24
27
  export { EmptyScreensBlockException } from "./empty_screens_block_exception";
25
28
  export { InvalidScreenOrderException } from "./invalid_screen_order_exception";
26
29
  export { InvalidPartnerScreenException } from "./invalid_partner_screen_exception";
@@ -34,7 +37,6 @@ export { InvalidConsentConfigException } from "./invalid_consent_config_exceptio
34
37
  export { InvalidConsentInformationException } from "./invalid_consent_information_exception";
35
38
  export { MissingMLConfigurationBlockException } from "./missing_ml_configuration_block_exception";
36
39
  export { MissingNetworkConfigurationBlockException } from "./missing_network_configuration_block_exception";
37
- export { MissingPartnerConfigException } from "./missing_partner_config_exception";
38
40
  export { InvalidTestRouteException } from "./invalid_test_route_exception";
39
41
  export { LivenessFrameCountException } from "./liveness_frame_count_exception";
40
42
  export { MissingJobTypeException } from "./missing_job_type_exception";
@@ -1 +1 @@
1
- "use strict";export{IssueSeverity}from"./issue_severity";export{UseSmileIDErrorCode,errorCodeDetails,isNetworkErrorCode,isRetryableErrorCode}from"./use_smile_id_error_code";export{UseSmileIDException}from"./use_smile_id_exception";export{UseSmileIDValidationException}from"./use_smile_id_validation_exception";export{UseSmileIDBuilderException}from"./use_smile_id_builder_exception";export{UseSmileIDCameraException}from"./use_smile_id_camera_exception";export{UseSmileIDCameraSurfaceException}from"./use_smile_id_camera_surface_exception";export{UseSmileIDNetworkException}from"./use_smile_id_network_exception";export{UseSmileIDAttestationException}from"./use_smile_id_attestation_exception";export{UseSmileIDGeneralException}from"./use_smile_id_general_exception";export{BuilderValidationException}from"./builder_validation_exception";export{ConsentDeniedException,NavigationFailedException,ProcessingCancelledException,NetworkSetupException}from"./flow_exceptions";export{EmptyScreensBlockException}from"./empty_screens_block_exception";export{InvalidScreenOrderException}from"./invalid_screen_order_exception";export{InvalidPartnerScreenException}from"./invalid_partner_screen_exception";export{MissingCaptureForPreviewException}from"./missing_capture_for_preview_exception";export{DuplicateScreenTypeException}from"./duplicate_screen_type_exception";export{AgentModeWithEnhancedLivenessException}from"./agent_mode_with_enhanced_liveness_exception";export{InvalidSelfieCaptureConfigException}from"./invalid_selfie_capture_config_exception";export{InvalidDocumentCaptureConfigException}from"./invalid_document_capture_config_exception";export{InvalidMissingCaptureTypeException}from"./invalid_missing_capture_type_exception";export{InvalidConsentConfigException}from"./invalid_consent_config_exception";export{InvalidConsentInformationException}from"./invalid_consent_information_exception";export{MissingMLConfigurationBlockException}from"./missing_ml_configuration_block_exception";export{MissingNetworkConfigurationBlockException}from"./missing_network_configuration_block_exception";export{MissingPartnerConfigException}from"./missing_partner_config_exception";export{InvalidTestRouteException}from"./invalid_test_route_exception";export{LivenessFrameCountException}from"./liveness_frame_count_exception";export{MissingJobTypeException}from"./missing_job_type_exception";export{MissingRequiredFieldException}from"./missing_required_field_exception";export{InvalidJobTypeScreenConfigException}from"./invalid_job_type_screen_config_exception";export{UnusedJobParamsException}from"./unused_job_params_exception";export{InvalidFieldValueException}from"./invalid_field_value_exception";export{NetworkServerException,NetworkTransportException,NetworkTimeoutException,NetworkResponseParseException,NetworkRequestBuildException,NetworkUnknownException}from"./use_smile_id_network_exception";
1
+ "use strict";export{IssueSeverity}from"./issue_severity";export{UseSmileIDErrorCode,errorCodeDetails,isNetworkErrorCode,isRetryableErrorCode}from"./use_smile_id_error_code";export{UseSmileIDException}from"./use_smile_id_exception";export{UseSmileIDValidationException}from"./use_smile_id_validation_exception";export{UseSmileIDBuilderException}from"./use_smile_id_builder_exception";export{UseSmileIDCameraException}from"./use_smile_id_camera_exception";export{UseSmileIDCameraSurfaceException}from"./use_smile_id_camera_surface_exception";export{UseSmileIDNetworkException}from"./use_smile_id_network_exception";export{UseSmileIDAttestationException}from"./use_smile_id_attestation_exception";export{UseSmileIDGeneralException}from"./use_smile_id_general_exception";export{BuilderValidationException}from"./builder_validation_exception";export{ConsentDeniedException}from"./consent_denied_exception";export{NavigationFailedException}from"./navigation_failed_exception";export{ProcessingCancelledException}from"./processing_cancelled_exception";export{NetworkSetupException}from"./network_setup_exception";export{EmptyScreensBlockException}from"./empty_screens_block_exception";export{InvalidScreenOrderException}from"./invalid_screen_order_exception";export{InvalidPartnerScreenException}from"./invalid_partner_screen_exception";export{MissingCaptureForPreviewException}from"./missing_capture_for_preview_exception";export{DuplicateScreenTypeException}from"./duplicate_screen_type_exception";export{AgentModeWithEnhancedLivenessException}from"./agent_mode_with_enhanced_liveness_exception";export{InvalidSelfieCaptureConfigException}from"./invalid_selfie_capture_config_exception";export{InvalidDocumentCaptureConfigException}from"./invalid_document_capture_config_exception";export{InvalidMissingCaptureTypeException}from"./invalid_missing_capture_type_exception";export{InvalidConsentConfigException}from"./invalid_consent_config_exception";export{InvalidConsentInformationException}from"./invalid_consent_information_exception";export{MissingMLConfigurationBlockException}from"./missing_ml_configuration_block_exception";export{MissingNetworkConfigurationBlockException}from"./missing_network_configuration_block_exception";export{InvalidTestRouteException}from"./invalid_test_route_exception";export{LivenessFrameCountException}from"./liveness_frame_count_exception";export{MissingJobTypeException}from"./missing_job_type_exception";export{MissingRequiredFieldException}from"./missing_required_field_exception";export{InvalidJobTypeScreenConfigException}from"./invalid_job_type_screen_config_exception";export{UnusedJobParamsException}from"./unused_job_params_exception";export{InvalidFieldValueException}from"./invalid_field_value_exception";export{NetworkServerException,NetworkTransportException,NetworkTimeoutException,NetworkResponseParseException,NetworkRequestBuildException,NetworkUnknownException}from"./use_smile_id_network_exception";
@@ -0,0 +1,13 @@
1
+ import { UseSmileIDGeneralException } from "./use_smile_id_general_exception";
2
+ /**
3
+ * The flow's navigation failed: njia refused to start the flow's engine, or a
4
+ * call to it failed. Surfaced through `onResult.failure` with
5
+ * `GENERAL_INVALID_STATE` and njia's error as its `cause`, as the native SDKs
6
+ * surface it through their general exception.
7
+ */
8
+ export declare class NavigationFailedException extends UseSmileIDGeneralException {
9
+ readonly errorCode: "GENERAL_INVALID_STATE";
10
+ constructor(args: {
11
+ cause: unknown;
12
+ });
13
+ }
@@ -0,0 +1 @@
1
+ "use strict";import{UseSmileIDErrorCode as s}from"./use_smile_id_error_code";import{UseSmileIDGeneralException as i}from"./use_smile_id_general_exception";export class NavigationFailedException extends i{errorCode=s.General.InvalidState;constructor(e){super({message:`The flow's navigation failed: ${e.cause instanceof Error?e.cause.message:String(e.cause)}`,suggestedFix:"Contact Smile ID support if the issue persists.",cause:e.cause})}}
@@ -0,0 +1,11 @@
1
+ import { UseSmileIDGeneralException } from "./use_smile_id_general_exception";
2
+ /**
3
+ * The flow's native network client couldn't be set up, so the flow ends at start rather than run
4
+ * with no network. Surfaced through `onResult.failure`; `cause` says why.
5
+ */
6
+ export declare class NetworkSetupException extends UseSmileIDGeneralException {
7
+ readonly errorCode: "GENERAL_OPERATION_FAILED";
8
+ constructor(args: {
9
+ cause: unknown;
10
+ });
11
+ }
@@ -0,0 +1 @@
1
+ "use strict";import{UseSmileIDErrorCode as s}from"./use_smile_id_error_code";import{UseSmileIDGeneralException as o}from"./use_smile_id_general_exception";export class NetworkSetupException extends o{errorCode=s.General.OperationFailed;constructor(e){super({message:"The flow's network client couldn't be set up",suggestedFix:"Check the cause. A missing or outdated native module needs @smileid/usesmileid_bridge at the SDK's version and a rebuild of the app's native code.",cause:e.cause})}}
@@ -0,0 +1,14 @@
1
+ import { UseSmileIDGeneralException } from "./use_smile_id_general_exception";
2
+ /**
3
+ * The user exited the processing screen before submission completed.
4
+ *
5
+ * Surfaced through `onResult.failure` so partners can distinguish a
6
+ * user-initiated cancellation from a submission error, mirroring the
7
+ * native SDKs' `ProcessingCancelledException`. An optional `cause` carries a submission failure that preceded the exit.
8
+ */
9
+ export declare class ProcessingCancelledException extends UseSmileIDGeneralException {
10
+ readonly errorCode: "GENERAL_OPERATION_FAILED";
11
+ constructor(args?: {
12
+ cause?: unknown;
13
+ });
14
+ }
@@ -0,0 +1 @@
1
+ "use strict";import{UseSmileIDErrorCode as s}from"./use_smile_id_error_code";import{UseSmileIDGeneralException as r}from"./use_smile_id_general_exception";export class ProcessingCancelledException extends r{errorCode=s.General.OperationFailed;constructor(e={}){super({message:"Processing was cancelled",suggestedFix:"The user exited the processing screen before submission completed.",...e.cause!==void 0?{cause:e.cause}:{}})}}
@@ -1,5 +1,5 @@
1
1
  import type * as ScreenOrientation from "expo-screen-orientation";
2
- import type { GlobalPrivacyControl } from "./global_privacy_control";
2
+ import type { GlobalPrivacyControl } from "../../presentation/flow/config/global_privacy_control";
3
3
  /**
4
4
  * Global SDK configuration flags. Snapshot produced by
5
5
  * `UseSmileIDConfigBuilder.build()` — every field is populated, with
@@ -1,10 +1,4 @@
1
- import type { ImageTypeId } from "@smileid/usesmileid_bridge";
2
1
  import type { SdkConfig } from "../model/sdk_config";
3
- /**
4
- * Capture quality of `kind` as a 0-1 fraction: the token's `sdk_config` value when in `1..100`, else the
5
- * SDK default. It seeds the recompress start; seeding above the real capture quality inflates the image.
6
- */
7
- export declare function resolveCaptureQuality(sdkConfig: SdkConfig | undefined, kind: ImageTypeId): number;
8
2
  /**
9
3
  * Per-role JPEG sizes in MB, measured before compression (`*Original`) and after (`*Final`); equal
10
4
  * when the image was not compressed, `undefined` for an absent role. Stamped into the submission
@@ -1 +1 @@
1
- "use strict";import{File as l}from"expo-file-system";import{ImageType as n}from"@smileid/usesmileid_bridge";import{CameraDefaults as a}from"../../camera/camera_defaults";import{resolveJpegQuality as r}from"../model/sdk_config_capture";import{CompressibleAssets as d}from"./compressible_asset";import{PayloadCompressor as p}from"./payload_compressor";import{UriCompressibleAsset as i}from"./uri_compressible_asset";const b=.95,D=.8;export function resolveCaptureQuality(e,t){const[s,c]=t===n.Selfie?[e?.selfie,b]:t===n.Liveness?[e?.liveness,D]:[e?.document,a.documentJpegQuality],m=r(s);return m===void 0?c:m/100}const v=1024*1024;function o(e){if(e===void 0)return;const t=new l(e).size??0;return t>0?t/v:void 0}export const PayloadCompressionRunner={async compress(e){const t=o(e.selfieImage),s=o(e.frontDocument),c=o(e.backDocument),m=o(e.visaDocument),u=new d({selfie:e.selfieImage?new i(n.Selfie,e.selfieImage,resolveCaptureQuality(e.sdkConfig,n.Selfie)):void 0,liveness:(e.livenessImages??[]).map(f=>new i(n.Liveness,f,resolveCaptureQuality(e.sdkConfig,n.Liveness))),documentFront:e.frontDocument?new i(n.DocumentFront,e.frontDocument,resolveCaptureQuality(e.sdkConfig,n.DocumentFront)):void 0,documentBack:e.backDocument?new i(n.DocumentBack,e.backDocument,resolveCaptureQuality(e.sdkConfig,n.DocumentBack)):void 0,documentVisa:e.visaDocument?new i(n.DocumentVisa,e.visaDocument,resolveCaptureQuality(e.sdkConfig,n.DocumentVisa)):void 0});return await p.prepareBundleForTransmission(u,e.metadataBytes),{selfieOriginalMb:t,selfieFinalMb:o(e.selfieImage),frontOriginalMb:s,frontFinalMb:o(e.frontDocument),backOriginalMb:c,backFinalMb:o(e.backDocument),visaOriginalMb:m,visaFinalMb:o(e.visaDocument)}}};
1
+ "use strict";import{File as a}from"expo-file-system";import{ImageType as n}from"@smileid/usesmileid_bridge";import{resolveCaptureQuality as i}from"../model/sdk_config_capture";import{CompressibleAssets as d}from"./compressible_asset";import{PayloadCompressor as r}from"./payload_compressor";import{UriCompressibleAsset as t}from"./uri_compressible_asset";const b=1024*1024;function o(e){if(e===void 0)return;const m=new a(e).size??0;return m>0?m/b:void 0}export const PayloadCompressionRunner={async compress(e){const m=o(e.selfieImage),s=o(e.frontDocument),c=o(e.backDocument),f=o(e.visaDocument),u=new d({selfie:e.selfieImage?new t(n.Selfie,e.selfieImage,i(e.sdkConfig,n.Selfie)):void 0,liveness:(e.livenessImages??[]).map(l=>new t(n.Liveness,l,i(e.sdkConfig,n.Liveness))),documentFront:e.frontDocument?new t(n.DocumentFront,e.frontDocument,i(e.sdkConfig,n.DocumentFront)):void 0,documentBack:e.backDocument?new t(n.DocumentBack,e.backDocument,i(e.sdkConfig,n.DocumentBack)):void 0,documentVisa:e.visaDocument?new t(n.DocumentVisa,e.visaDocument,i(e.sdkConfig,n.DocumentVisa)):void 0});return await r.prepareBundleForTransmission(u,e.metadataBytes),{selfieOriginalMb:m,selfieFinalMb:o(e.selfieImage),frontOriginalMb:s,frontFinalMb:o(e.frontDocument),backOriginalMb:c,backFinalMb:o(e.backDocument),visaOriginalMb:f,visaFinalMb:o(e.visaDocument)}}};
@@ -1,4 +1,4 @@
1
- import { UseSmileIDBuilderException } from "./use_smile_id_builder_exception";
1
+ import { UseSmileIDBuilderException } from "../../core/exception/use_smile_id_builder_exception";
2
2
  /**
3
3
  * A `network { }` block was provided but a required partner-configuration
4
4
  * field (`partnerId` or the auth `token`) was missing or blank.
@@ -0,0 +1 @@
1
+ "use strict";import{UseSmileIDBuilderException as t}from"../../core/exception/use_smile_id_builder_exception";import{UseSmileIDErrorCode as r}from"../../core/exception/use_smile_id_error_code";export class MissingPartnerConfigException extends t{errorCode=r.Builder.InvalidConfiguration;constructor(e){super({message:e.message,suggestedFix:`Configure the missing field '${e.fieldName}' in the network config block.`,errorDetails:{fieldName:e.fieldName}})}static missingPartnerId(){return new MissingPartnerConfigException({message:"Partner ID is required but was not configured",fieldName:"partnerId"})}static missingAuthToken(){return new MissingPartnerConfigException({message:"Auth token is required but was not configured",fieldName:"authToken"})}static controlCharacterPartnerId(){return new MissingPartnerConfigException({message:"Partner ID must not contain control characters",fieldName:"partnerId"})}static controlCharacterAuthToken(){return new MissingPartnerConfigException({message:"Auth token must not contain control characters",fieldName:"authToken"})}static unresolvableCallbackUrl(){return new MissingPartnerConfigException({message:"Callback URL must be left unset, an absolute http or https URL, or a callback ID",fieldName:"callbackUrl"})}}
@@ -1 +1 @@
1
- "use strict";import{SmileIDAPI as l}from"../api/smile_id_api";import{Attestation as m}from"@smileid/usesmileid_bridge";import{BridgeSubmissions as f}from"../api/bridge_submissions";import{testRoutePort as p}from"../api/test_route";import{MissingPartnerConfigException as n}from"../../core/exception";import{UseSmileIDMetadataFactory as h}from"../../metadata/use_smile_id_metadata_factory";export function makeNetworkingFactory(t,o={}){const r=t.config?.partnerConfig;if(!r||r.partnerId.trim()==="")throw n.missingPartnerId();if(!t.config?.token||t.config.token.trim()==="")throw n.missingAuthToken();const i=/[\u0000-\u001F\u007F-\u009F]/;if(i.test(r.partnerId))throw n.controlCharacterPartnerId();if(i.test(t.config.token))throw n.controlCharacterAuthToken();if(!isResolvableCallbackUrl(r.callbackUrl??""))throw n.unresolvableCallbackUrl();const e=o.capturing===!0,a=new h,c=p(t)??null,s=o.bridge??f.configure(t,o.nativeClient,c),u=new l(r,s,e);return e||m.warmUp().catch(()=>{}),{api:u,metadata:a,bridge:s}}const d=/^callback_[0-9a-hjkmnp-tv-z]{26}$/;export function isResolvableCallbackUrl(t){if(t===""||d.test(t))return!0;const o=t.indexOf("://");if(o<=0)return!1;const r=t.slice(0,o).toLowerCase();if(r!=="http"&&r!=="https")return!1;const e=((t.slice(o+3).split(/[/?#]/)[0]??"").split("@").pop()??"").split(":")[0]??"";return e!==""&&!/[\s\u0000-\u001F\u007F-\u009F]/.test(e)}
1
+ "use strict";import{SmileIDAPI as l}from"../api/smile_id_api";import{Attestation as m}from"@smileid/usesmileid_bridge";import{BridgeSubmissions as f}from"../api/bridge_submissions";import{testRoutePort as p}from"../api/test_route";import{MissingPartnerConfigException as n}from"../exception/missing_partner_config_exception";import{UseSmileIDMetadataFactory as h}from"../../metadata/use_smile_id_metadata_factory";export function makeNetworkingFactory(t,o={}){const r=t.config?.partnerConfig;if(!r||r.partnerId.trim()==="")throw n.missingPartnerId();if(!t.config?.token||t.config.token.trim()==="")throw n.missingAuthToken();const i=/[\u0000-\u001F\u007F-\u009F]/;if(i.test(r.partnerId))throw n.controlCharacterPartnerId();if(i.test(t.config.token))throw n.controlCharacterAuthToken();if(!isResolvableCallbackUrl(r.callbackUrl??""))throw n.unresolvableCallbackUrl();const e=o.capturing===!0,a=new h,c=p(t)??null,s=o.bridge??f.configure(t,o.nativeClient,c),u=new l(r,s,e);return e||m.warmUp().catch(()=>{}),{api:u,metadata:a,bridge:s}}const d=/^callback_[0-9a-hjkmnp-tv-z]{26}$/;export function isResolvableCallbackUrl(t){if(t===""||d.test(t))return!0;const o=t.indexOf("://");if(o<=0)return!1;const r=t.slice(0,o).toLowerCase();if(r!=="http"&&r!=="https")return!1;const e=((t.slice(o+3).split(/[/?#]/)[0]??"").split("@").pop()??"").split(":")[0]??"";return e!==""&&!/[\s\u0000-\u001F\u007F-\u009F]/.test(e)}
@@ -1,5 +1,7 @@
1
1
  import { z } from "zod";
2
+ import type { ImageTypeId } from "@smileid/usesmileid_bridge";
2
3
  import type { ImageDimensions } from "./image_dimensions";
4
+ import type { SdkConfig } from "./sdk_config";
3
5
  /**
4
6
  * Per-capture-type block inside an `sdk_config` JWT claim.
5
7
  *
@@ -36,3 +38,9 @@ export declare function resolveDimensions(capture: SdkConfigCapture | undefined)
36
38
  * clamped — the caller uses the SDK default instead.
37
39
  */
38
40
  export declare function resolveJpegQuality(capture: SdkConfigCapture | undefined): number | undefined;
41
+ /**
42
+ * Capture quality of `kind` as a 0-1 fraction: the token's {@link resolveJpegQuality} value for that
43
+ * kind, else the {@link CameraDefaults} preset. It seeds the recompress start; seeding above the real
44
+ * capture quality inflates the image.
45
+ */
46
+ export declare function resolveCaptureQuality(sdkConfig: SdkConfig | undefined, kind: ImageTypeId): number;
@@ -1 +1 @@
1
- "use strict";import{z as i}from"zod";export const sdkConfigCaptureSchema=i.object({width:i.number().int().optional(),height:i.number().int().optional(),quality:i.number().int().optional()});export function resolveDimensions(e){if(!e)return;const{width:n,height:t}=e;if(n!==void 0&&t!==void 0&&n>0&&t>0)return{width:n,height:t}}export function resolveJpegQuality(e){const n=e?.quality;if(n!==void 0&&n>=1&&n<=100)return n}
1
+ "use strict";import{z as i}from"zod";import{ImageType as u}from"@smileid/usesmileid_bridge";import{CameraDefaults as r}from"../../camera/core/camera_defaults";export const sdkConfigCaptureSchema=i.object({width:i.number().int().optional(),height:i.number().int().optional(),quality:i.number().int().optional()});export function resolveDimensions(t){if(!t)return;const{width:e,height:n}=t;if(e!==void 0&&n!==void 0&&e>0&&n>0)return{width:e,height:n}}export function resolveJpegQuality(t){const e=t?.quality;if(e!==void 0&&e>=1&&e<=100)return e}export function resolveCaptureQuality(t,e){const[n,l]=e===u.Selfie?[t?.selfie,r.jpegQualityForSelfie]:e===u.Liveness?[t?.liveness,r.jpegQualityForLiveness]:[t?.document,r.jpegQualityForDocument],o=resolveJpegQuality(n);return o===void 0?l:o/100}
@@ -1 +1 @@
1
- "use strict";import{DocumentInteriorCrop as u}from"../presentation/components/helpers/document_interior_crop";export const DocumentPreviewDebugGeometry={inPlace(t,h,n){if(c(t)||c(h))return null;const r=u.cardScale(t,h,n),o=f(h.width/2,h.height/2,t.width*r,t.height*r);return{frameRect:o,plannedInteriorRect:d(o,w(t,n)*r)}},panel(t,h,n,r){if(c(t)||c(h)||c(n))return null;const o=Math.min(n.width/t.width,n.height/t.height),e=f(n.width/2,n.height/2,t.width*o,t.height*o),l=u.cardScale(t,h,r);return{frameRect:e,plannedInteriorRect:d(e,w(t,r)*o),visibleCardRect:f(n.width/2,n.height/2,h.width/l*o,h.height/l*o)}}};function w(t,h){return Math.min(Math.max(h,0),u.fullBorderFraction)*Math.min(t.width,t.height)}function f(t,h,n,r){return{left:t-n/2,top:h-r/2,width:n,height:r}}function d(t,h){return{left:t.left+h,top:t.top+h,width:t.width-2*h,height:t.height-2*h}}function c(t){return t.width<=0||t.height<=0}
1
+ "use strict";import{DocumentInteriorCrop as u}from"../presentation/components/document_interior_crop";export const DocumentPreviewDebugGeometry={inPlace(t,h,n){if(c(t)||c(h))return null;const r=u.cardScale(t,h,n),o=f(h.width/2,h.height/2,t.width*r,t.height*r);return{frameRect:o,plannedInteriorRect:d(o,w(t,n)*r)}},panel(t,h,n,r){if(c(t)||c(h)||c(n))return null;const o=Math.min(n.width/t.width,n.height/t.height),e=f(n.width/2,n.height/2,t.width*o,t.height*o),l=u.cardScale(t,h,r);return{frameRect:e,plannedInteriorRect:d(e,w(t,r)*o),visibleCardRect:f(n.width/2,n.height/2,h.width/l*o,h.height/l*o)}}};function w(t,h){return Math.min(Math.max(h,0),u.fullBorderFraction)*Math.min(t.width,t.height)}function f(t,h,n,r){return{left:t-n/2,top:h-r/2,width:n,height:r}}function d(t,h){return{left:t.left+h,top:t.top+h,width:t.width-2*h,height:t.height-2*h}}function c(t){return t.width<=0||t.height<=0}
@@ -1,4 +1,4 @@
1
- import type { capturedOvalRegion } from "../presentation/components/helpers/captured_oval_region";
1
+ import type { capturedOvalRegion } from "../presentation/components/captured_oval_region";
2
2
  /** How the preview places the selfie in its oval. */
3
3
  export type SelfiePreviewPlacement = ReturnType<typeof capturedOvalRegion>;
4
4
  /** A width × height in layout units (or image pixels). */
@@ -1 +1 @@
1
- "use strict";import{SelfieInteriorCrop as l}from"../presentation/components/helpers/selfie_interior_crop";const i=l.borderFraction;export const SelfiePreviewDebugGeometry={plannedBorderFraction:i,inPlace(t,h,o){if(e(t)||e(h))return null;const f=o.scale(t,h),n={width:t.width*f,height:t.height*f},d=o.offset(n,h),r={left:h.left+d.x,top:h.top+d.y,...n};return{frameRect:r,plannedInteriorRect:u(r,w(t)*f)}},panel(t,h,o,f){if(e(t)||e(h)||e(o))return null;const n=Math.min(o.width/t.width,o.height/t.height),d=s({x:o.width/2,y:o.height/2},{width:t.width*n,height:t.height*n}),r=f.scale(t,h),c=f.offset({width:t.width*r,height:t.height*r},h);return{frameRect:d,plannedInteriorRect:u(d,w(t)*n),visibleOvalRect:{left:d.left-c.x/r*n,top:d.top-c.y/r*n,width:h.width/r*n,height:h.height/r*n}}}};function w(t){return i*Math.min(t.width,t.height)}function s(t,h){return{left:t.x-h.width/2,top:t.y-h.height/2,width:h.width,height:h.height}}function u(t,h){return{left:t.left+h,top:t.top+h,width:t.width-2*h,height:t.height-2*h}}function e(t){return t.width<=0||t.height<=0}
1
+ "use strict";import{SelfieInteriorCrop as l}from"../presentation/components/selfie_interior_crop";const i=l.borderFraction;export const SelfiePreviewDebugGeometry={plannedBorderFraction:i,inPlace(t,h,o){if(e(t)||e(h))return null;const f=o.scale(t,h),n={width:t.width*f,height:t.height*f},d=o.offset(n,h),r={left:h.left+d.x,top:h.top+d.y,...n};return{frameRect:r,plannedInteriorRect:u(r,w(t)*f)}},panel(t,h,o,f){if(e(t)||e(h)||e(o))return null;const n=Math.min(o.width/t.width,o.height/t.height),d=s({x:o.width/2,y:o.height/2},{width:t.width*n,height:t.height*n}),r=f.scale(t,h),c=f.offset({width:t.width*r,height:t.height*r},h);return{frameRect:d,plannedInteriorRect:u(d,w(t)*n),visibleOvalRect:{left:d.left-c.x/r*n,top:d.top-c.y/r*n,width:h.width/r*n,height:h.height/r*n}}}};function w(t){return i*Math.min(t.width,t.height)}function s(t,h){return{left:t.x-h.width/2,top:t.y-h.height/2,width:h.width,height:h.height}}function u(t,h){return{left:t.left+h,top:t.top+h,width:t.width-2*h,height:t.height-2*h}}function e(t){return t.width<=0||t.height<=0}
@@ -1 +1 @@
1
- "use strict";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{useEffect as b,useId as D,useState as m}from"react";import{Image as w,Pressable as x,StyleSheet as d,Text as f,View as o}from"react-native";import{useSafeAreaInsets as p}from"react-native-safe-area-context";import g,{ClipPath as E,Defs as $,Ellipse as u,Path as h}from"react-native-svg";import{decodeUprightImageSize as A}from"../presentation/components/helpers/selfie_interior_crop";import{SelfiePreviewDebugGeometry as S}from"./selfie_preview_debug_geometry";import{BORDER_RING_FILL as _,BOUNDARY_STROKE as v,HIDDEN_TODAY_DIM as F,PANEL_WIDTH as I,PlannedBoundary as y,VISIBLE_BOUNDARY_COLOR as R,debugPreviewStyles as O,rectPath as T,ringPath as P}from"./preview_debug_drawing";import{capturedImageUri as L}from"../presentation/components/helpers/captured_image_uri";import{UseSmileIDDebugHud as U}from"./use_smile_id_debug_hud";export function UseSmileIDSelfiePreviewDebugOverlay(e){const t=p(),[l,n]=m(null);return b(()=>{let c=!0;return A(e.uri).then(z=>{c&&n(z)}),()=>{c=!1}},[e.uri]),a(o,{pointerEvents:"box-none",style:d.absoluteFill,testID:"si_debug_selfie_preview_overlay",children:[l?i(o,{pointerEvents:"none",style:d.absoluteFill,children:i(SelfiePreviewHiddenRegionsInPlace,{imageSize:l,ovalRect:e.ovalRect,placement:e.placement})}):null,i(o,{style:[r.hudAnchor,{top:t.top+8}],children:i(U,{title:"Frame",children:i(k,{uri:e.uri,imageSize:l,ovalSize:e.ovalRect,placement:e.placement})})})]})}export function SelfiePreviewHiddenRegionsInPlace(e){const t=`si_debug_oval_clip_${D().replace(/:/g,"")}`,l=S.inPlace(e.imageSize,e.ovalRect,e.placement);if(!l)return null;const n=e.ovalRect;return a(g,{width:"100%",height:"100%",testID:"si_debug_selfie_preview_in_place",children:[i($,{children:i(E,{id:t,children:i(u,{...s(n)})})}),i(h,{d:P(l.frameRect,l.plannedInteriorRect),fill:_,fillRule:"evenodd",clipPath:`url(#${t})`}),i(y,{rect:l.plannedInteriorRect}),i(u,{...s(n),fill:"none",stroke:R,strokeWidth:v})]})}export function SelfiePreviewPanelMarkings(e){const t=S.panel(e.imageSize,e.ovalSize,e.panelSize,e.placement);if(!t)return null;const l=t.visibleOvalRect;return a(g,{width:e.panelSize.width,height:e.panelSize.height,style:d.absoluteFill,testID:"si_debug_selfie_preview_panel_markings",children:[i(h,{d:`${T(t.frameRect)} ${H(l)}`,fill:F,fillRule:"evenodd"}),i(h,{d:P(t.frameRect,t.plannedInteriorRect),fill:_,fillRule:"evenodd"}),i(y,{rect:t.plannedInteriorRect}),i(u,{...s(l),fill:"none",stroke:R,strokeWidth:v})]})}export function SelfiePreviewDebugHud(e){const[t,l]=m(!0);return a(o,{style:r.hud,children:[a(o,{style:r.hudHeader,children:[t?i(f,{style:r.hudText,children:e.title}):null,i(x,{accessibilityRole:"button",testID:"si_debug_hud_toggle",onPress:()=>l(n=>!n),hitSlop:8,style:r.hudChevron,children:i(f,{style:r.hudText,children:t?"\u25B2":"\u25BC"})})]}),t?e.children:null]})}function k(e){const t=e.imageSize?e.imageSize.width/e.imageSize.height:N,l={width:I,height:I/t};return a(o,{style:[r.panel,l],testID:"si_debug_selfie_preview_panel",children:[i(w,{source:{uri:L(e.uri)},resizeMode:"contain",style:d.absoluteFill}),e.imageSize?i(SelfiePreviewPanelMarkings,{imageSize:e.imageSize,ovalSize:e.ovalSize,placement:e.placement,panelSize:l}):null]})}function s(e){return{cx:e.left+e.width/2,cy:e.top+e.height/2,rx:e.width/2,ry:e.height/2}}function H(e){const{cx:t,cy:l,rx:n,ry:c}=s(e);return`M${t-n},${l} a${n},${c} 0 1,0 ${2*n},0 a${n},${c} 0 1,0 ${-2*n},0 Z`}const N=3/4,r=O;
1
+ "use strict";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{useEffect as b,useId as D,useState as m}from"react";import{Image as w,Pressable as x,StyleSheet as d,Text as f,View as o}from"react-native";import{useSafeAreaInsets as p}from"react-native-safe-area-context";import g,{ClipPath as E,Defs as $,Ellipse as u,Path as h}from"react-native-svg";import{decodeUprightImageSize as A}from"../presentation/components/selfie_interior_crop";import{SelfiePreviewDebugGeometry as S}from"./selfie_preview_debug_geometry";import{BORDER_RING_FILL as _,BOUNDARY_STROKE as v,HIDDEN_TODAY_DIM as F,PANEL_WIDTH as I,PlannedBoundary as y,VISIBLE_BOUNDARY_COLOR as R,debugPreviewStyles as O,rectPath as T,ringPath as P}from"./preview_debug_drawing";import{capturedImageUri as L}from"../presentation/components/helpers/captured_image_uri";import{UseSmileIDDebugHud as U}from"./use_smile_id_debug_hud";export function UseSmileIDSelfiePreviewDebugOverlay(e){const t=p(),[l,n]=m(null);return b(()=>{let c=!0;return A(e.uri).then(z=>{c&&n(z)}),()=>{c=!1}},[e.uri]),a(o,{pointerEvents:"box-none",style:d.absoluteFill,testID:"si_debug_selfie_preview_overlay",children:[l?i(o,{pointerEvents:"none",style:d.absoluteFill,children:i(SelfiePreviewHiddenRegionsInPlace,{imageSize:l,ovalRect:e.ovalRect,placement:e.placement})}):null,i(o,{style:[r.hudAnchor,{top:t.top+8}],children:i(U,{title:"Frame",children:i(k,{uri:e.uri,imageSize:l,ovalSize:e.ovalRect,placement:e.placement})})})]})}export function SelfiePreviewHiddenRegionsInPlace(e){const t=`si_debug_oval_clip_${D().replace(/:/g,"")}`,l=S.inPlace(e.imageSize,e.ovalRect,e.placement);if(!l)return null;const n=e.ovalRect;return a(g,{width:"100%",height:"100%",testID:"si_debug_selfie_preview_in_place",children:[i($,{children:i(E,{id:t,children:i(u,{...s(n)})})}),i(h,{d:P(l.frameRect,l.plannedInteriorRect),fill:_,fillRule:"evenodd",clipPath:`url(#${t})`}),i(y,{rect:l.plannedInteriorRect}),i(u,{...s(n),fill:"none",stroke:R,strokeWidth:v})]})}export function SelfiePreviewPanelMarkings(e){const t=S.panel(e.imageSize,e.ovalSize,e.panelSize,e.placement);if(!t)return null;const l=t.visibleOvalRect;return a(g,{width:e.panelSize.width,height:e.panelSize.height,style:d.absoluteFill,testID:"si_debug_selfie_preview_panel_markings",children:[i(h,{d:`${T(t.frameRect)} ${H(l)}`,fill:F,fillRule:"evenodd"}),i(h,{d:P(t.frameRect,t.plannedInteriorRect),fill:_,fillRule:"evenodd"}),i(y,{rect:t.plannedInteriorRect}),i(u,{...s(l),fill:"none",stroke:R,strokeWidth:v})]})}export function SelfiePreviewDebugHud(e){const[t,l]=m(!0);return a(o,{style:r.hud,children:[a(o,{style:r.hudHeader,children:[t?i(f,{style:r.hudText,children:e.title}):null,i(x,{accessibilityRole:"button",testID:"si_debug_hud_toggle",onPress:()=>l(n=>!n),hitSlop:8,style:r.hudChevron,children:i(f,{style:r.hudText,children:t?"\u25B2":"\u25BC"})})]}),t?e.children:null]})}function k(e){const t=e.imageSize?e.imageSize.width/e.imageSize.height:N,l={width:I,height:I/t};return a(o,{style:[r.panel,l],testID:"si_debug_selfie_preview_panel",children:[i(w,{source:{uri:L(e.uri)},resizeMode:"contain",style:d.absoluteFill}),e.imageSize?i(SelfiePreviewPanelMarkings,{imageSize:e.imageSize,ovalSize:e.ovalSize,placement:e.placement,panelSize:l}):null]})}function s(e){return{cx:e.left+e.width/2,cy:e.top+e.height/2,rx:e.width/2,ry:e.height/2}}function H(e){const{cx:t,cy:l,rx:n,ry:c}=s(e);return`M${t-n},${l} a${n},${c} 0 1,0 ${2*n},0 a${n},${c} 0 1,0 ${-2*n},0 Z`}const N=3/4,r=O;
package/dist/index.d.ts CHANGED
@@ -10,18 +10,19 @@ export { UseSmileIDBuilder } from "./presentation/flow/dsl/use_smile_id_builder"
10
10
  export { UseSmileIDFlowBuilder } from "./presentation/flow/dsl/use_smile_id_flow_builder";
11
11
  export type { FlowBuildResult, FlowBuildResultInvalid, FlowBuildResultSuccess, } from "./presentation/flow/dsl/flow_build_result";
12
12
  export { ValidationState, type ValidationIssue, type ValidationStateInvalid, } from "./presentation/flow/validation/validation_state";
13
- export { AgentModeWithEnhancedLivenessException, BuilderValidationException, isNetworkErrorCode, isRetryableErrorCode, ConsentDeniedException, DuplicateScreenTypeException, EmptyScreensBlockException, InvalidConsentConfigException, InvalidConsentInformationException, InvalidDocumentCaptureConfigException, InvalidFieldValueException, InvalidJobTypeScreenConfigException, InvalidMissingCaptureTypeException, InvalidScreenOrderException, InvalidPartnerScreenException, InvalidSelfieCaptureConfigException, LivenessFrameCountException, IssueSeverity, MissingCaptureForPreviewException, MissingJobTypeException, MissingMLConfigurationBlockException, MissingNetworkConfigurationBlockException, MissingPartnerConfigException, InvalidTestRouteException, MissingRequiredFieldException, NavigationFailedException, ProcessingCancelledException, NetworkSetupException, UseSmileIDAttestationException, UseSmileIDBuilderException, UseSmileIDCameraException, UseSmileIDCameraSurfaceException, UseSmileIDErrorCode, type UseSmileIDErrorCategory, type UseSmileIDErrorCodeDetails, UseSmileIDException, UseSmileIDGeneralException, UnusedJobParamsException, UseSmileIDNetworkException, type UseSmileIDNetworkErrorCode, UseSmileIDValidationException, errorCodeDetails, } from "./core/exception";
14
- export { UseSmileIDConfigBuilder } from "./presentation/flow/dsl/builder/config_builder";
15
- export { ThemeConfigBuilder, type AdaptiveColor, type ThemeConfiguration, } from "./presentation/flow/dsl/builder/theme_builder";
13
+ export { AgentModeWithEnhancedLivenessException, BuilderValidationException, isNetworkErrorCode, isRetryableErrorCode, ConsentDeniedException, DuplicateScreenTypeException, EmptyScreensBlockException, InvalidConsentConfigException, InvalidConsentInformationException, InvalidDocumentCaptureConfigException, InvalidFieldValueException, InvalidJobTypeScreenConfigException, InvalidMissingCaptureTypeException, InvalidScreenOrderException, InvalidPartnerScreenException, InvalidSelfieCaptureConfigException, LivenessFrameCountException, IssueSeverity, MissingCaptureForPreviewException, MissingJobTypeException, MissingMLConfigurationBlockException, MissingNetworkConfigurationBlockException, InvalidTestRouteException, MissingRequiredFieldException, NavigationFailedException, ProcessingCancelledException, NetworkSetupException, UseSmileIDAttestationException, UseSmileIDBuilderException, UseSmileIDCameraException, UseSmileIDCameraSurfaceException, UseSmileIDErrorCode, type UseSmileIDErrorCategory, type UseSmileIDErrorCodeDetails, UseSmileIDException, UseSmileIDGeneralException, UnusedJobParamsException, UseSmileIDNetworkException, type UseSmileIDNetworkErrorCode, UseSmileIDValidationException, errorCodeDetails, } from "./core/exception";
14
+ export { MissingPartnerConfigException } from "./data/exception/missing_partner_config_exception";
15
+ export { UseSmileIDConfigBuilder } from "./presentation/flow/config/use_smile_id_config_builder";
16
+ export { ThemeConfigBuilder, type AdaptiveColor, type ThemeConfiguration, } from "./presentation/flow/dsl/theme_config_builder";
16
17
  export { UseSmileIDNetworkBuilder } from "./data/dsl/use_smile_id_network_builder";
17
18
  export { ConfigBuilder, LoggingConfigBuilder, PartnerConfigBuilder, } from "./data/dsl/builder/config_builder";
18
19
  export { TimeoutConfigBuilder } from "./data/dsl/builder/timeout_config_builder";
19
20
  export { CacheConfigBuilder } from "./data/dsl/builder/cache_config_builder";
20
21
  export { RetryConfigBuilder, RetryStrategy, } from "./data/dsl/builder/retry_config_builder";
21
22
  export { InterceptorConfigBuilder } from "./data/dsl/builder/interceptor_config_builder";
22
- export { AnalyzerRegistryBuilder, DocumentAnalyzerScope, FaceAnalyzerScope, UseSmileIDMLBuilder, } from "./presentation/flow/dsl/builder/ml_builder";
23
- export { CaptureConfigBuilder, CaptureType, ConsentConfigBuilder, DocumentCaptureConfigBuilder, InstructionsConfigBuilder, PreviewConfigBuilder, ProcessingConfigBuilder, ScreensBuilder, SelfieCaptureConfigBuilder, type ButtonSlot, type PartnerScreenConfig, type PartnerStepScope, type ScreenSpec, type ScreensConfig, } from "./presentation/flow/dsl/builder/screens_builder";
24
- export { PartnerValueFormat } from "./presentation/flow/dsl/builder/partner_value_format";
23
+ export { AnalyzerRegistryBuilder, DocumentAnalyzerScope, FaceAnalyzerScope, UseSmileIDMLBuilder, } from "./bridge/dsl/use_smile_id_ml_builder";
24
+ export { CaptureConfigBuilder, CaptureType, ConsentConfigBuilder, DocumentCaptureConfigBuilder, InstructionsConfigBuilder, PreviewConfigBuilder, ProcessingConfigBuilder, ScreensBuilder, SelfieCaptureConfigBuilder, type ButtonSlot, type PartnerScreenConfig, type PartnerStepScope, type ScreenSpec, type ScreensConfig, } from "./presentation/flow/dsl/screen_builders";
25
+ export { PartnerValueFormat } from "./presentation/flow/config/partner_value_format";
25
26
  export type { FlowConfiguration } from "./presentation/flow/config/flow_configuration";
26
27
  export { FlowNavigationManager, type CapturedArtifacts, type FlowExitHandler, type FlowExitReason, } from "./presentation/flow/flow_navigation_manager";
27
28
  export { FlowNavigationProvider, useFlowNavigation, type FlowNavigationProviderProps, } from "./presentation/flow/flow_navigation_context";
@@ -40,22 +41,22 @@ export { AnalyzerNotFoundException, UseSmileIDMLErrorCode, UseSmileIDMLException
40
41
  export { UseSmileIDLocalizations } from "./l10n/use_smile_id_localizations";
41
42
  export { UseSmileIDLocalizationsProvider, useStableLocalizations, useUseSmileIDLocalizations, type UseSmileIDLocalizationsProviderProps, } from "./l10n/use_smile_id_localizations_provider";
42
43
  export { enStrings, type SiKey } from "./l10n/strings_en";
43
- export { UseSmileIDKameraCameraSystem, type KameraSessionLike, } from "./camera/use_smile_id_kamera_camera_system";
44
- export { UseSmileIDKameraPreview, type UseSmileIDKameraPreviewProps, } from "./camera/use_smile_id_kamera_preview";
45
- export { useSmileIDFrameStream, type UseSmileIDFrameStream, type UseSmileIDFrameStreamOptions, } from "./camera/use_smile_id_frame_stream";
46
- export { CameraDefaults } from "./camera/camera_defaults";
47
- export { CameraLens } from "./camera/camera_lens";
48
- export { FocusStates, type FocusPoint, type FocusState, } from "./camera/focus_state";
49
- export type { CameraConfiguration, CameraSystemState, } from "./camera/camera_configuration";
50
- export { getCameraPermissionStatus, requestCameraPermission, type CameraPermissionStatus, } from "./camera/camera_permissions";
44
+ export { UseSmileIDKameraCameraSystem, type KameraSessionLike, } from "./camera/core/use_smile_id_kamera_camera_system";
45
+ export { UseSmileIDKameraPreview, type UseSmileIDKameraPreviewProps, } from "./camera/ui/use_smile_id_kamera_preview";
46
+ export { useSmileIDFrameStream, type UseSmileIDFrameStream, type UseSmileIDFrameStreamOptions, } from "./camera/core/use_smile_id_frame_stream";
47
+ export { CameraDefaults } from "./camera/core/camera_defaults";
48
+ export { CameraLens } from "./camera/core/camera_lens";
49
+ export { FocusStates, type FocusPoint, type FocusState, } from "./camera/core/focus_state";
50
+ export type { CameraConfiguration, CameraSystemState, } from "./camera/core/camera_configuration";
51
+ export { getCameraPermissionStatus, requestCameraPermission, type CameraPermissionStatus, } from "./camera/util/camera_permissions";
51
52
  export { JobType, jobTypeFromValue, requiresDocument, requiresSelfie, type JobTypeName, } from "./core/models/job_type";
52
53
  export { FlowStep } from "./core/models/flow_step";
53
- export { DocumentType, type DocumentOrientation, type GenericDocumentArgs, } from "./core/models/document_type";
54
- export { DEFAULT_ACTIVATE_MANUAL_AFTER_MS, DocumentCaptureMode, type AutoCaptureWithManualFallbackArgs, } from "./core/models/document_capture_mode";
54
+ export { DocumentType, type DocumentOrientation, type GenericDocumentArgs, } from "./presentation/flow/config/document_type";
55
+ export { DEFAULT_ACTIVATE_MANUAL_AFTER_MS, DocumentCaptureMode, type AutoCaptureWithManualFallbackArgs, } from "./presentation/flow/config/document_capture_mode";
55
56
  export { cancelled, captured, failure, success, type UseSmileIDResult, } from "./core/models/result";
56
57
  export type { CapturedJob } from "./data/model/captured_job";
57
58
  export type { ConfigOptions } from "./core/models/config";
58
- export { GlobalPrivacyControl, GLOBAL_PRIVACY_CONTROL_WIRE_KEY, globalPrivacyControlFromWire, } from "./core/models/global_privacy_control";
59
+ export { GlobalPrivacyControl, GLOBAL_PRIVACY_CONTROL_WIRE_KEY, globalPrivacyControlFromWire, } from "./presentation/flow/config/global_privacy_control";
59
60
  export { LogLevel } from "./core/models/network_config";
60
61
  export { type UseSmileIDOnRequest, type UseSmileIDOnResponse, type UseSmileIDRequestInfo, type UseSmileIDResponseInfo, } from "./data/api/hooks/partner_hooks";
61
62
  export type { CacheConfig, NetworkConfig, NetworkInnerConfig, NetworkLoggingConfig, PartnerConfig, RetryConfig, TimeoutConfig, } from "./core/models/network_config";
@@ -115,7 +116,7 @@ export { mapCaptureUiState, mapSelfieUiState, mapDocumentUiState, preCaptureUiSt
115
116
  export { resolveFeedbackCopy, selfieFeedbackKeyFor, documentFeedbackKeyFor, } from "./presentation/screen/helpers/capture_screen_helpers";
116
117
  export { UseSmileIDFeedbackDebouncer } from "./presentation/screen/helpers/feedback_debouncer";
117
118
  export { UseSmileIDOverlayState, OVERLAY_STATE_COUNT, isDirectional, } from "./presentation/state/use_smile_id_overlay_state";
118
- export { HEAD_TURN_DIRECTIONS, type HeadTurnDirection, } from "./core/models/head_turn_direction";
119
+ export { HEAD_TURN_DIRECTIONS, type HeadTurnDirection, } from "./bridge/model/head_turn_direction";
119
120
  export { UseSmileIDCaptureScreen, type UseSmileIDCaptureScreenProps, } from "./presentation/screen/use_smile_id_capture_screen";
120
121
  export { UseSmileIDConsentScreen, type UseSmileIDConsentScreenProps, } from "./presentation/screen/use_smile_id_consent_screen";
121
122
  export { UseSmileIDInstructionsScreen, type UseSmileIDInstructionsScreenProps, } from "./presentation/screen/use_smile_id_instructions_screen";