@incodetech/core 0.0.0-dev-20260409-a38d5e8 → 0.0.0-dev-20260409-089e5c6

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 (137) hide show
  1. package/dist/BrowserStorageProvider-ByxoNfxC.esm.js +55 -0
  2. package/dist/{OpenViduRecordingProvider-Bn2meybK.esm.js → OpenViduRecordingProvider-JatjSE3h.esm.js} +1 -1
  3. package/dist/{WasmUtilProvider-BpZSvZbg.esm.js → WasmUtilProvider-DRh0wrlm.esm.js} +1 -1
  4. package/dist/{addressSearch-DOFI7lwy.esm.js → addressSearch-CDdN30un.esm.js} +4 -4
  5. package/dist/antifraud.d.ts +1 -1
  6. package/dist/antifraud.esm.js +4 -37
  7. package/dist/antifraudStateMachine-C1AgS0nL.esm.js +39 -0
  8. package/dist/authentication.d.ts +11 -11
  9. package/dist/authentication.esm.js +22 -19
  10. package/dist/{authenticationManager-C2mk36yK.d.ts → authenticationManager-DYFYx68i.d.ts} +2 -2
  11. package/dist/authenticationManager-UaO9UTN7.esm.js +67 -0
  12. package/dist/{authenticationManager-C7dL_avf.esm.js → authenticationStateMachine-DWI65EwK.esm.js} +7 -67
  13. package/dist/{backCameraStream-tabTmwDS.esm.js → backCameraStream-BihRmMzc.esm.js} +3 -3
  14. package/dist/camera.d.ts +1 -1
  15. package/dist/camera.esm.js +3 -3
  16. package/dist/consent.d.ts +57 -57
  17. package/dist/consent.esm.js +4 -149
  18. package/dist/consentStateMachine-CpRu2hF0.esm.js +151 -0
  19. package/dist/cross-document-data-match.d.ts +1 -1
  20. package/dist/cross-document-data-match.esm.js +4 -4
  21. package/dist/curp-validation.d.ts +5 -5
  22. package/dist/curp-validation.esm.js +4 -417
  23. package/dist/curpValidationStateMachine-Czzgv2W1.esm.js +419 -0
  24. package/dist/{deepsightLoader-Cj6SyUQ-.esm.js → deepsightLoader-jIgoauFK.esm.js} +10 -10
  25. package/dist/{deepsightService-BjgXl5hs.esm.js → deepsightService-D4mM8yJ2.esm.js} +5 -5
  26. package/dist/{deepsightService-ByD6uIs7.d.ts → deepsightService-DAeakjDd.d.ts} +2 -2
  27. package/dist/device.esm.js +3 -3
  28. package/dist/document-capture.d.ts +75 -73
  29. package/dist/document-capture.esm.js +8 -403
  30. package/dist/document-upload.d.ts +50 -50
  31. package/dist/document-upload.esm.js +7 -7
  32. package/dist/documentCaptureStateMachine-XbpsHzh5.esm.js +403 -0
  33. package/dist/ekyb.d.ts +3 -3
  34. package/dist/ekyb.esm.js +10 -655
  35. package/dist/ekybStateMachine-BDuCae6s.esm.js +653 -0
  36. package/dist/ekyc.d.ts +3 -3
  37. package/dist/ekyc.esm.js +6 -10614
  38. package/dist/ekycStateMachine-BN4KBDYY.esm.js +10615 -0
  39. package/dist/email.d.ts +3 -3
  40. package/dist/email.esm.js +6 -5
  41. package/dist/emailManager-CAeo59lD.esm.js +238 -0
  42. package/dist/{emailManager-CU_hzrsl.d.ts → emailManager-CZYfcu0n.d.ts} +4 -3
  43. package/dist/{emailManager-_9R4vm6g.esm.js → emailStateMachine-Bqwe_sQS.esm.js} +6 -239
  44. package/dist/{events-DlHrOIRc.esm.js → events-CZ2ka3pu.esm.js} +8 -1
  45. package/dist/events.d.ts +1 -0
  46. package/dist/events.esm.js +2 -2
  47. package/dist/extensibility.d.ts +15 -15
  48. package/dist/extensibility.esm.js +33 -26
  49. package/dist/face-match.d.ts +7 -6
  50. package/dist/face-match.esm.js +8 -129
  51. package/dist/faceCaptureManagerFactory-D8zlMTvd.esm.js +117 -0
  52. package/dist/{faceCaptureManagerFactory-Da_-ohdg.d.ts → faceCaptureManagerFactory-DS-6yCya.d.ts} +8 -8
  53. package/dist/{faceCaptureSetup-CaVWkjvE.esm.js → faceCaptureSetup-1M6uUEjK.esm.js} +5 -119
  54. package/dist/faceMatchStateMachine-D3DuP_ya.esm.js +127 -0
  55. package/dist/flow.d.ts +8 -13
  56. package/dist/flow.esm.js +10 -29
  57. package/dist/{flowCompletionService-B5JemmC6.esm.js → flowCompletionService-W6bj7Xd3.esm.js} +2 -2
  58. package/dist/{flowServices-p22wrYPf.esm.js → flowServices-C4tjBD8q.esm.js} +3 -3
  59. package/dist/geolocation.d.ts +7 -6
  60. package/dist/geolocation.esm.js +7 -105
  61. package/dist/geolocationStateMachine-Bj2LkGwy.esm.js +105 -0
  62. package/dist/{getDeviceClass-DEzz4cmY.esm.js → getDeviceClass-BoiWvKAc.esm.js} +1 -1
  63. package/dist/government-validation.d.ts +2 -2
  64. package/dist/government-validation.esm.js +5 -269
  65. package/dist/governmentValidationStateMachine-W1CzRjVw.esm.js +271 -0
  66. package/dist/http.esm.js +1 -1
  67. package/dist/id.d.ts +10 -10
  68. package/dist/id.esm.js +22 -20
  69. package/dist/idCaptureManager-BcS8fgW4.esm.js +335 -0
  70. package/dist/{idCaptureManager-CV08v1e3.d.ts → idCaptureManager-oR6YPYHj.d.ts} +7 -7
  71. package/dist/{idCaptureManager-dyZzKv8L.esm.js → idCaptureStateMachine-MAzfM_2O.esm.js} +17 -346
  72. package/dist/identity-reuse.d.ts +530 -0
  73. package/dist/identity-reuse.esm.js +273 -0
  74. package/dist/index.d.ts +2 -2
  75. package/dist/index.esm.js +8 -8
  76. package/dist/{lib-Bavz2qmt.esm.js → lib-CxDxnzRd.esm.js} +1 -1
  77. package/dist/mandatory-consent.d.ts +55 -55
  78. package/dist/mandatory-consent.esm.js +4 -124
  79. package/dist/mandatoryConsentStateMachine-BMKi26Re.esm.js +126 -0
  80. package/dist/{openviduLazy-vhrVZCr_.esm.js → openviduLazy-B8tinh9W.esm.js} +2 -2
  81. package/dist/openviduLazy-CItjpMfL.esm.js +3 -0
  82. package/dist/{permissionServices-Cskq32Yd.esm.js → permissionServices-Cj120WaT.esm.js} +2 -2
  83. package/dist/phone.d.ts +3 -3
  84. package/dist/phone.esm.js +6 -5
  85. package/dist/phoneManager-Bvj6Jr4o.esm.js +258 -0
  86. package/dist/{phoneManager-ulJuGvJ8.d.ts → phoneManager-CCMCkyYr.d.ts} +2 -2
  87. package/dist/{phoneManager-DerdUfd4.esm.js → phoneStateMachine-B1t1Z-Dd.esm.js} +5 -258
  88. package/dist/{recordingService-483wQ6kR.esm.js → recordingService-8I_-hhNI.esm.js} +14 -68
  89. package/dist/redirect-to-mobile.d.ts +2 -2
  90. package/dist/redirect-to-mobile.esm.js +5 -247
  91. package/dist/redirectToMobileStateMachine-BVP1KcoO.esm.js +249 -0
  92. package/dist/runChildModule-B5DEiOS7.esm.js +27 -0
  93. package/dist/selfie.d.ts +11 -11
  94. package/dist/selfie.esm.js +22 -19
  95. package/dist/selfieManager-B6x3O5Ns.esm.js +60 -0
  96. package/dist/{selfieManager-DCRP7X75.d.ts → selfieManager-gizt3Zha.d.ts} +2 -2
  97. package/dist/selfieStateMachine-DHPSBFj0.esm.js +56 -0
  98. package/dist/{session-CUh77zj3.esm.js → session-DoI-X9FK.esm.js} +4 -4
  99. package/dist/session.d.ts +1 -1
  100. package/dist/session.esm.js +6 -6
  101. package/dist/{setup-XpxfZgKn.esm.js → setup-Bh2S53NT.esm.js} +6 -5
  102. package/dist/{setup-DpHakxsC.d.ts → setup-Bz3Ffaoc.d.ts} +1 -1
  103. package/dist/signature.d.ts +4 -3
  104. package/dist/signature.esm.js +6 -189
  105. package/dist/signatureStateMachine-Cv7yPuEf.esm.js +189 -0
  106. package/dist/{stats-DHDoqSBV.esm.js → stats-wkQyDFV3.esm.js} +1 -1
  107. package/dist/stats.esm.js +2 -2
  108. package/dist/types-BdEM5Jj7.d.ts +35 -0
  109. package/dist/{types-2OPf1pyv.d.ts → types-CdlQrTiZ.d.ts} +1 -1
  110. package/dist/{types-CVJVQ7fp.d.ts → types-m43DfiSx.d.ts} +1 -1
  111. package/dist/wasm.d.ts +2 -2
  112. package/dist/wasm.esm.js +8 -8
  113. package/dist/workflow.d.ts +813 -0
  114. package/dist/workflow.esm.js +600 -0
  115. package/package.json +11 -3
  116. package/dist/openviduLazy-BIPHozOu.esm.js +0 -3
  117. package/dist/selfieManager-DeOcNel4.esm.js +0 -110
  118. /package/dist/{Actor-Ba71-_30.d.ts → Actor-BkPcZGke.d.ts} +0 -0
  119. /package/dist/{BaseWasmProvider-D-s_6M5H.esm.js → BaseWasmProvider-C73c2nV9.esm.js} +0 -0
  120. /package/dist/{BrowserEnvironmentProvider-DaHeLJQw.esm.js → BrowserEnvironmentProvider-lxn4oxXn.esm.js} +0 -0
  121. /package/dist/{BrowserTimerProvider-BhD2MlHg.esm.js → BrowserTimerProvider-CSdm7__S.esm.js} +0 -0
  122. /package/dist/{ITimerCapability-oixwa6nj.esm.js → ITimerCapability-DAIaq369.esm.js} +0 -0
  123. /package/dist/{Manager-BN2g_I8W.d.ts → Manager-Bcnemkyi.d.ts} +0 -0
  124. /package/dist/{MotionSensorProvider-CodM3e0E.esm.js → MotionSensorProvider-BLnFo6My.esm.js} +0 -0
  125. /package/dist/{StateMachine-BoJsfMvg.d.ts → StateMachine-DIeoDJ7r.d.ts} +0 -0
  126. /package/dist/{api-DzpnV6O7.esm.js → api-CqKwkjJ3.esm.js} +0 -0
  127. /package/dist/{browserSimulation-B4ubb2OL.esm.js → browserSimulation-7W5-A3RV.esm.js} +0 -0
  128. /package/dist/{camera-DmkFpf5N.esm.js → camera-B-5traWf.esm.js} +0 -0
  129. /package/dist/{camera-1eeGnAaL.d.ts → camera-CgnuDuxy.d.ts} +0 -0
  130. /package/dist/{chunk-DsxENsBR.esm.js → chunk-Qw4qVmMx.esm.js} +0 -0
  131. /package/dist/{displayErrors-BZLX7idb.d.ts → displayErrors-C9-VaqmS.d.ts} +0 -0
  132. /package/dist/{flowCompletionService-D-3YCHyO.d.ts → flowCompletionService-CPLdZxe-.d.ts} +0 -0
  133. /package/dist/{getBrowser-Dtyt9J_h.esm.js → getBrowser-DJkbzQ5t.esm.js} +0 -0
  134. /package/dist/{platform-Dv7a2fv-.esm.js → platform-BfoqeM61.esm.js} +0 -0
  135. /package/dist/{types-D_QfFKxT.d.ts → types-CxU9jTRl.d.ts} +0 -0
  136. /package/dist/{warmup-CIj_wEV_.d.ts → warmup-Cs0uqxUW.d.ts} +0 -0
  137. /package/dist/{xstate.esm-Bv55-lJ4.esm.js → xstate.esm-D7D6CGwY.esm.js} +0 -0
@@ -0,0 +1,249 @@
1
+ import { t as api } from "./api-CqKwkjJ3.esm.js";
2
+ import { _ as endpoints } from "./events-CZ2ka3pu.esm.js";
3
+ import { i as fromPromise, n as assign, r as fromCallback, t as setup } from "./xstate.esm-D7D6CGwY.esm.js";
4
+ import { t as BrowserTimerProvider } from "./BrowserTimerProvider-CSdm7__S.esm.js";
5
+
6
+ //#region ../infra/src/url/urlUtils.ts
7
+ function getUrlSearchParam(url, param) {
8
+ try {
9
+ return new URL(url).searchParams.get(param);
10
+ } catch {
11
+ return null;
12
+ }
13
+ }
14
+ function buildUrlWithSearchParams(baseUrl, params) {
15
+ const url = new URL(baseUrl);
16
+ for (const [key, value] of Object.entries(params)) if (value !== void 0) url.searchParams.set(key, value);
17
+ return url.href;
18
+ }
19
+
20
+ //#endregion
21
+ //#region src/modules/redirect-to-mobile/redirectToMobileServices.ts
22
+ async function fetchRedirectUrl(signal) {
23
+ const res = await api.get(endpoints.onboardingUrl, { signal });
24
+ if (!res.ok) throw new Error(`GET ${endpoints.onboardingUrl} failed: ${res.status} ${res.statusText}`);
25
+ return res.data;
26
+ }
27
+ async function fetchOnboardingStatus(signal) {
28
+ const res = await api.get(endpoints.onboardingStatus, { signal });
29
+ if (!res.ok) throw new Error(`GET ${endpoints.onboardingStatus} failed: ${res.status} ${res.statusText}`);
30
+ return res.data;
31
+ }
32
+ async function sendRedirectSms(params, signal) {
33
+ const res = await api.post(endpoints.sendRedirectSms, params, { signal });
34
+ if (!res.ok) throw new Error(`POST ${endpoints.sendRedirectSms} failed: ${res.status} ${res.statusText}`);
35
+ }
36
+ async function addPhoneForRedirect(phone, signal) {
37
+ const res = await api.post(endpoints.phone, { phone }, { signal });
38
+ if (!res.ok) throw new Error(`POST ${endpoints.phone} failed: ${res.status} ${res.statusText}`);
39
+ }
40
+ async function refreshQrUuid(onboardingId, signal) {
41
+ const res = await api.post(endpoints.qrRefreshUuid, { onboardingId }, { signal });
42
+ if (!res.ok) throw new Error(`POST ${endpoints.qrRefreshUuid} failed: ${res.status} ${res.statusText}`);
43
+ return res.data;
44
+ }
45
+ async function fetchStartInfo(signal) {
46
+ const res = await api.get(endpoints.startInfo, { signal });
47
+ if (!res.ok) throw new Error(`GET ${endpoints.startInfo} failed: ${res.status} ${res.statusText}`);
48
+ return res.data;
49
+ }
50
+
51
+ //#endregion
52
+ //#region src/modules/redirect-to-mobile/redirectToMobileStateMachine.ts
53
+ const POLL_INTERVAL_MS = 5e3;
54
+ const QR_REFRESH_INTERVAL_MS = 5e3;
55
+ function buildRedirectUrl(baseUrl, customUrl, config, urlUuid) {
56
+ const uuid = getUrlSearchParam(baseUrl, "uuid") ?? "";
57
+ return buildUrlWithSearchParams(customUrl ?? baseUrl, {
58
+ uuid,
59
+ isRedirect: "true",
60
+ lang: config.lang,
61
+ externalId: config.externalId,
62
+ auth_hint: config.authHint,
63
+ url_uuid: urlUuid || void 0
64
+ });
65
+ }
66
+ function extractUuidFromUrl(url) {
67
+ return getUrlSearchParam(url, "uuid") ?? "";
68
+ }
69
+ const redirectToMobileMachine = setup({
70
+ types: {
71
+ context: {},
72
+ events: {},
73
+ input: {}
74
+ },
75
+ actors: {
76
+ fetchRedirectUrl: fromPromise(async ({ signal }) => {
77
+ return fetchRedirectUrl(signal);
78
+ }),
79
+ fetchStartInfo: fromPromise(async ({ signal }) => {
80
+ return fetchStartInfo(signal);
81
+ }),
82
+ pollOnboardingStatus: fromCallback(({ sendBack }) => {
83
+ const timer = BrowserTimerProvider.getInstance();
84
+ const interval = timer.setInterval(async () => {
85
+ try {
86
+ if ((await fetchOnboardingStatus()).onboardingStatus === "ONBOARDING_FINISHED") sendBack({ type: "POLL_TICK" });
87
+ } catch {}
88
+ }, POLL_INTERVAL_MS);
89
+ return () => timer.clearInterval(interval);
90
+ }),
91
+ refreshQrUuid: fromCallback(({ sendBack, input }) => {
92
+ const timer = BrowserTimerProvider.getInstance();
93
+ const interval = timer.setInterval(async () => {
94
+ try {
95
+ const res = await refreshQrUuid(input.uuid);
96
+ if (res.urlUuid) sendBack({
97
+ type: "QR_REFRESHED",
98
+ urlUuid: res.urlUuid
99
+ });
100
+ } catch {}
101
+ }, QR_REFRESH_INTERVAL_MS);
102
+ return () => timer.clearInterval(interval);
103
+ }),
104
+ sendSms: fromPromise(async ({ input, signal }) => {
105
+ await addPhoneForRedirect(input.phone, signal);
106
+ const params = input.lang ? [`lang=${input.lang}`] : [];
107
+ await sendRedirectSms({
108
+ smsType: "DESKTOP_ONBOARDING",
109
+ uuid: input.uuid,
110
+ params
111
+ }, signal);
112
+ })
113
+ },
114
+ actions: {
115
+ setBaseUrl: assign(({ context, event }) => {
116
+ const baseUrl = event.output.url;
117
+ return {
118
+ fetchedBaseUrl: baseUrl,
119
+ uuid: extractUuidFromUrl(baseUrl),
120
+ redirectUrl: buildRedirectUrl(baseUrl, context.config.url, context.config, context.urlUuid)
121
+ };
122
+ }),
123
+ setStartInfo: assign(({ event }) => {
124
+ return { phonePrefix: event.output.phonePrefix };
125
+ }),
126
+ setError: assign(({ event }) => ({ error: String(event.error) })),
127
+ setSmsSent: assign({ smsSent: () => true }),
128
+ resetSmsSent: assign({
129
+ smsSent: () => false,
130
+ error: () => void 0
131
+ }),
132
+ setSmsError: assign(({ event }) => ({ error: String(event.error) })),
133
+ updateQrUrl: assign(({ context, event }) => {
134
+ const { urlUuid } = event;
135
+ return {
136
+ urlUuid,
137
+ redirectUrl: buildRedirectUrl(context.fetchedBaseUrl, context.config.url, context.config, urlUuid)
138
+ };
139
+ })
140
+ },
141
+ guards: { hasPhishingResistance: ({ context }) => context.config.qrPhishingResistance === true }
142
+ }).createMachine({
143
+ id: "redirectToMobile",
144
+ initial: "idle",
145
+ context: ({ input }) => ({
146
+ config: input.config,
147
+ redirectUrl: "",
148
+ fetchedBaseUrl: "",
149
+ uuid: "",
150
+ urlUuid: "",
151
+ phonePrefix: "",
152
+ smsSent: false,
153
+ error: void 0
154
+ }),
155
+ states: {
156
+ idle: { on: { LOAD: "generatingUrl" } },
157
+ generatingUrl: { invoke: {
158
+ id: "fetchRedirectUrl",
159
+ src: "fetchRedirectUrl",
160
+ onDone: {
161
+ target: "loadingStartInfo",
162
+ actions: "setBaseUrl"
163
+ },
164
+ onError: {
165
+ target: "error",
166
+ actions: "setError"
167
+ }
168
+ } },
169
+ loadingStartInfo: { invoke: {
170
+ id: "fetchStartInfo",
171
+ src: "fetchStartInfo",
172
+ onDone: {
173
+ target: "showingQr",
174
+ actions: "setStartInfo"
175
+ },
176
+ onError: { target: "showingQr" }
177
+ } },
178
+ showingQr: {
179
+ type: "parallel",
180
+ states: {
181
+ polling: {
182
+ invoke: {
183
+ id: "pollOnboardingStatus",
184
+ src: "pollOnboardingStatus"
185
+ },
186
+ on: { POLL_TICK: { target: "#redirectToMobile.finished" } }
187
+ },
188
+ qrRefresh: {
189
+ initial: "checking",
190
+ states: {
191
+ checking: { always: [{
192
+ target: "refreshing",
193
+ guard: "hasPhishingResistance"
194
+ }, { target: "inactive" }] },
195
+ refreshing: {
196
+ invoke: {
197
+ id: "refreshQrUuid",
198
+ src: "refreshQrUuid",
199
+ input: ({ context }) => ({ uuid: context.uuid })
200
+ },
201
+ on: { QR_REFRESHED: { actions: "updateQrUrl" } }
202
+ },
203
+ inactive: { type: "final" }
204
+ }
205
+ },
206
+ sms: {
207
+ initial: "idle",
208
+ states: {
209
+ idle: { on: { SEND_SMS: "sending" } },
210
+ sending: { invoke: {
211
+ id: "sendSms",
212
+ src: "sendSms",
213
+ input: ({ context, event }) => ({
214
+ phone: event.phone,
215
+ uuid: context.uuid,
216
+ lang: context.config.lang
217
+ }),
218
+ onDone: {
219
+ target: "sent",
220
+ actions: "setSmsSent"
221
+ },
222
+ onError: {
223
+ target: "idle",
224
+ actions: "setSmsError"
225
+ }
226
+ } },
227
+ sent: { on: {
228
+ SEND_SMS: "sending",
229
+ RESET_SMS: {
230
+ target: "idle",
231
+ actions: "resetSmsSent"
232
+ }
233
+ } }
234
+ }
235
+ }
236
+ },
237
+ on: {
238
+ CONTINUE_ON_DESKTOP: "closed",
239
+ CLOSE: "closed"
240
+ }
241
+ },
242
+ finished: { type: "final" },
243
+ closed: { type: "final" },
244
+ error: { on: { RETRY: "generatingUrl" } }
245
+ }
246
+ });
247
+
248
+ //#endregion
249
+ export { redirectToMobileMachine as t };
@@ -0,0 +1,27 @@
1
+ import { a as createActor, r as fromCallback } from "./xstate.esm-D7D6CGwY.esm.js";
2
+
3
+ //#region src/internal/orchestration/runChildModule.ts
4
+ const runChildModule = fromCallback(({ sendBack, input }) => {
5
+ const { machine, config } = input;
6
+ if (!machine) return () => {};
7
+ const actor = createActor(machine, { input: { config } });
8
+ const subscription = actor.subscribe({
9
+ complete: () => {
10
+ sendBack({ type: "MODULE_COMPLETE" });
11
+ },
12
+ error: (err) => {
13
+ sendBack({
14
+ type: "MODULE_ERROR",
15
+ error: err
16
+ });
17
+ }
18
+ });
19
+ actor.start();
20
+ return () => {
21
+ subscription.unsubscribe();
22
+ actor.stop();
23
+ };
24
+ });
25
+
26
+ //#endregion
27
+ export { runChildModule as t };
package/dist/selfie.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- import "./warmup-CIj_wEV_.js";
2
- import "./Manager-BN2g_I8W.js";
3
- import "./Actor-Ba71-_30.js";
4
- import "./StateMachine-BoJsfMvg.js";
5
- import { a as SelfieMachine, d as SelfieConfig, o as selfieMachine, v as DetectionStatus, y as FaceErrorCode } from "./faceCaptureManagerFactory-Da_-ohdg.js";
6
- import { t as CameraStream } from "./camera-1eeGnAaL.js";
7
- import "./types-2OPf1pyv.js";
8
- import "./types-CVJVQ7fp.js";
9
- import { t as DeepsightService } from "./deepsightService-ByD6uIs7.js";
10
- import { n as PermissionStatus, t as PermissionResult } from "./types-D_QfFKxT.js";
11
- import { a as ProcessFaceResponse, n as SelfieState, o as processFace, r as createSelfieManager, t as SelfieManager } from "./selfieManager-DCRP7X75.js";
1
+ import "./warmup-Cs0uqxUW.js";
2
+ import "./Manager-Bcnemkyi.js";
3
+ import "./Actor-BkPcZGke.js";
4
+ import "./StateMachine-DIeoDJ7r.js";
5
+ import { a as SelfieMachine, d as SelfieConfig, o as selfieMachine, v as DetectionStatus, y as FaceErrorCode } from "./faceCaptureManagerFactory-DS-6yCya.js";
6
+ import { t as CameraStream } from "./camera-CgnuDuxy.js";
7
+ import "./types-CdlQrTiZ.js";
8
+ import "./types-m43DfiSx.js";
9
+ import { t as DeepsightService } from "./deepsightService-DAeakjDd.js";
10
+ import { n as PermissionStatus, t as PermissionResult } from "./types-CxU9jTRl.js";
11
+ import { a as ProcessFaceResponse, n as SelfieState, o as processFace, r as createSelfieManager, t as SelfieManager } from "./selfieManager-gizt3Zha.js";
12
12
  export { type CameraStream, type DeepsightService, type DetectionStatus, type FaceErrorCode, type PermissionResult, type PermissionStatus, type ProcessFaceResponse, type SelfieConfig, type SelfieMachine, type SelfieManager, type SelfieState, createSelfieManager, processFace, selfieMachine };
@@ -1,21 +1,24 @@
1
- import "./BaseWasmProvider-D-s_6M5H.esm.js";
2
- import "./WasmUtilProvider-BpZSvZbg.esm.js";
3
- import "./api-DzpnV6O7.esm.js";
4
- import "./events-DlHrOIRc.esm.js";
5
- import "./browserSimulation-B4ubb2OL.esm.js";
6
- import "./xstate.esm-Bv55-lJ4.esm.js";
7
- import "./faceCaptureSetup-CaVWkjvE.esm.js";
8
- import { l as processFace } from "./recordingService-483wQ6kR.esm.js";
9
- import "./deepsightService-BjgXl5hs.esm.js";
10
- import "./camera-DmkFpf5N.esm.js";
11
- import "./getBrowser-Dtyt9J_h.esm.js";
12
- import "./stats-DHDoqSBV.esm.js";
13
- import "./MotionSensorProvider-CodM3e0E.esm.js";
14
- import "./permissionServices-Cskq32Yd.esm.js";
15
- import "./platform-Dv7a2fv-.esm.js";
16
- import "./ITimerCapability-oixwa6nj.esm.js";
17
- import "./backCameraStream-tabTmwDS.esm.js";
18
- import "./getDeviceClass-DEzz4cmY.esm.js";
19
- import { r as selfieMachine, t as createSelfieManager } from "./selfieManager-DeOcNel4.esm.js";
1
+ import "./BaseWasmProvider-C73c2nV9.esm.js";
2
+ import "./WasmUtilProvider-DRh0wrlm.esm.js";
3
+ import "./api-CqKwkjJ3.esm.js";
4
+ import "./events-CZ2ka3pu.esm.js";
5
+ import "./browserSimulation-7W5-A3RV.esm.js";
6
+ import "./xstate.esm-D7D6CGwY.esm.js";
7
+ import "./faceCaptureManagerFactory-D8zlMTvd.esm.js";
8
+ import "./BrowserStorageProvider-ByxoNfxC.esm.js";
9
+ import { l as processFace } from "./recordingService-8I_-hhNI.esm.js";
10
+ import "./deepsightService-D4mM8yJ2.esm.js";
11
+ import "./camera-B-5traWf.esm.js";
12
+ import "./getBrowser-DJkbzQ5t.esm.js";
13
+ import "./stats-wkQyDFV3.esm.js";
14
+ import "./MotionSensorProvider-BLnFo6My.esm.js";
15
+ import "./permissionServices-Cj120WaT.esm.js";
16
+ import "./platform-BfoqeM61.esm.js";
17
+ import "./ITimerCapability-DAIaq369.esm.js";
18
+ import "./backCameraStream-BihRmMzc.esm.js";
19
+ import "./getDeviceClass-BoiWvKAc.esm.js";
20
+ import "./faceCaptureSetup-1M6uUEjK.esm.js";
21
+ import { t as selfieMachine } from "./selfieStateMachine-DHPSBFj0.esm.js";
22
+ import { t as createSelfieManager } from "./selfieManager-B6x3O5Ns.esm.js";
20
23
 
21
24
  export { createSelfieManager, processFace, selfieMachine };
@@ -0,0 +1,60 @@
1
+ import { t as WasmUtilProvider } from "./WasmUtilProvider-DRh0wrlm.esm.js";
2
+ import { n as eventModuleNames } from "./events-CZ2ka3pu.esm.js";
3
+ import { a as createActor } from "./xstate.esm-D7D6CGwY.esm.js";
4
+ import { t as createFaceCaptureManagerFromActor } from "./faceCaptureManagerFactory-D8zlMTvd.esm.js";
5
+ import { t as BrowserStorageProvider } from "./BrowserStorageProvider-ByxoNfxC.esm.js";
6
+ import { t as selfieMachine } from "./selfieStateMachine-DHPSBFj0.esm.js";
7
+
8
+ //#region src/modules/selfie/selfieActor.ts
9
+ function createSelfieActor(options) {
10
+ const dependencies = options.dependencies ?? {
11
+ storage: new BrowserStorageProvider(),
12
+ getWasmUtil: () => WasmUtilProvider.getInstance()
13
+ };
14
+ return createActor(selfieMachine, { input: {
15
+ config: options.config,
16
+ dependencies,
17
+ authHint: options.authHint
18
+ } }).start();
19
+ }
20
+
21
+ //#endregion
22
+ //#region src/modules/selfie/selfieManager.ts
23
+ function createSelfieManagerFromActor(actor) {
24
+ return createFaceCaptureManagerFromActor(actor, eventModuleNames.selfie);
25
+ }
26
+ /**
27
+ * Creates a selfie manager instance for handling selfie capture flow.
28
+ *
29
+ * The selfie manager provides:
30
+ * - State management with statuses: `idle`, `loading`, `tutorial`, `permissions`, `capture`, `finished`, `closed`, `error`
31
+ * - Permission handling with nested states: `idle`, `requesting`, `denied`, `learnMore`
32
+ * - Capture handling with nested states: `initializing`, `startingRecorder`, `recordingActive`, `detecting`, `capturing`, `uploading`, `uploadError`, `success`
33
+ * - Camera stream access when in `capture` state
34
+ * - Detection status feedback during face detection
35
+ * - Attempt tracking with `attemptsRemaining`
36
+ *
37
+ * @param options - Configuration for the selfie actor
38
+ * @param options.config - The selfie module configuration from the flow
39
+ * @returns A manager instance with state subscription, API methods, and lifecycle controls
40
+ *
41
+ * @example
42
+ * ```ts
43
+ * const selfieManager = createSelfieManager({ config: selfieConfig });
44
+ *
45
+ * selfieManager.subscribe((state) => {
46
+ * if (state.status === 'capture') {
47
+ * console.log('Camera ready:', state.stream);
48
+ * console.log('Detection status:', state.detectionStatus);
49
+ * }
50
+ * });
51
+ *
52
+ * selfieManager.load();
53
+ * ```
54
+ */
55
+ function createSelfieManager(options) {
56
+ return createFaceCaptureManagerFromActor(createSelfieActor(options), eventModuleNames.selfie);
57
+ }
58
+
59
+ //#endregion
60
+ export { createSelfieManagerFromActor as n, createSelfieManager as t };
@@ -1,5 +1,5 @@
1
- import { t as Manager } from "./Manager-BN2g_I8W.js";
2
- import { i as SelfieActor, n as FaceCaptureManagerState, r as CreateSelfieActorOptions, t as FaceCaptureManager } from "./faceCaptureManagerFactory-Da_-ohdg.js";
1
+ import { t as Manager } from "./Manager-Bcnemkyi.js";
2
+ import { i as SelfieActor, n as FaceCaptureManagerState, r as CreateSelfieActorOptions, t as FaceCaptureManager } from "./faceCaptureManagerFactory-DS-6yCya.js";
3
3
 
4
4
  //#region src/modules/selfie/selfieUploadService.d.ts
5
5
  type ProcessFaceImageType = 'selfie' | 'videoSelfie';
@@ -0,0 +1,56 @@
1
+ import { i as fromPromise, n as assign } from "./xstate.esm-D7D6CGwY.esm.js";
2
+ import { l as processFace, u as uploadSelfie, v as FACE_ERROR_CODES } from "./recordingService-8I_-hhNI.esm.js";
3
+ import { t as faceCaptureMachine } from "./faceCaptureSetup-1M6uUEjK.esm.js";
4
+
5
+ //#region src/modules/selfie/selfieErrorUtils.ts
6
+ const FACE_ERROR_CODE_VALUES = Object.values(FACE_ERROR_CODES);
7
+ const validateUploadResponse = ({ config, response }) => {
8
+ if (!response) return FACE_ERROR_CODES.SERVER;
9
+ if (response.confidence !== 0) return FACE_ERROR_CODES.LIVENESS;
10
+ if (config.validateBrightness && !response.isBright) return FACE_ERROR_CODES.BRIGHTNESS;
11
+ if (config.validateLenses && response.hasLenses) return FACE_ERROR_CODES.LENSES;
12
+ if (config.validateFaceMask && response.hasFaceMask) return FACE_ERROR_CODES.MASK;
13
+ if (config.validateClosedEyes && response.hasClosedEyes) return FACE_ERROR_CODES.CLOSED_EYES;
14
+ if (config.validateHeadCover && response.hasHeadCover) return FACE_ERROR_CODES.HEAD_COVER;
15
+ };
16
+
17
+ //#endregion
18
+ //#region src/modules/selfie/selfieStateMachine.ts
19
+ const _selfieMachine = faceCaptureMachine.provide({
20
+ actors: {
21
+ uploadFace: fromPromise(async ({ input, signal }) => {
22
+ const ctx = input;
23
+ return uploadSelfie({
24
+ encryptedBase64Image: ctx.encryptedBase64Image,
25
+ faceCoordinates: ctx.faceCoordinates,
26
+ metadata: ctx.deepsightService?.getMetadata(),
27
+ recordingId: ctx.uploadRecordingId,
28
+ signal
29
+ });
30
+ }),
31
+ processFace: fromPromise(async ({ signal }) => {
32
+ return processFace("selfie", signal);
33
+ })
34
+ },
35
+ actions: { setUploadErrorFromUploadValidation: assign({ uploadError: ({ context }) => validateUploadResponse({
36
+ config: context.config,
37
+ response: context.uploadResponse
38
+ }) ?? FACE_ERROR_CODES.SERVER }) },
39
+ guards: {
40
+ hasUploadValidationError: ({ context }) => validateUploadResponse({
41
+ config: context.config,
42
+ response: context.uploadResponse
43
+ }) !== void 0,
44
+ isTerminalUploadError: () => false
45
+ }
46
+ });
47
+ /**
48
+ * The selfie capture state machine.
49
+ *
50
+ * Note: Uses AnyStateMachine type for declaration file portability.
51
+ * Type safety is ensured via the machine configuration.
52
+ */
53
+ const selfieMachine = _selfieMachine;
54
+
55
+ //#endregion
56
+ export { selfieMachine as t };
@@ -1,7 +1,7 @@
1
- import { n as getApi, t as api } from "./api-DzpnV6O7.esm.js";
2
- import { _ as endpoints, m as addEvent } from "./events-DlHrOIRc.esm.js";
3
- import { t as BrowserEnvironmentProvider } from "./BrowserEnvironmentProvider-DaHeLJQw.esm.js";
4
- import { t as isBrowserSimulation } from "./browserSimulation-B4ubb2OL.esm.js";
1
+ import { n as getApi, t as api } from "./api-CqKwkjJ3.esm.js";
2
+ import { _ as endpoints, m as addEvent } from "./events-CZ2ka3pu.esm.js";
3
+ import { t as BrowserEnvironmentProvider } from "./BrowserEnvironmentProvider-lxn4oxXn.esm.js";
4
+ import { t as isBrowserSimulation } from "./browserSimulation-7W5-A3RV.esm.js";
5
5
 
6
6
  //#region src/internal/session/sessionService.ts
7
7
  /**
package/dist/session.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as GetFinishStatusFn, r as getFinishStatus, t as FinishStatus } from "./flowCompletionService-D-3YCHyO.js";
1
+ import { n as GetFinishStatusFn, r as getFinishStatus, t as FinishStatus } from "./flowCompletionService-CPLdZxe-.js";
2
2
 
3
3
  //#region src/internal/session/sessionService.d.ts
4
4
  type CreateSessionOptions = {
@@ -1,8 +1,8 @@
1
- import "./api-DzpnV6O7.esm.js";
2
- import "./events-DlHrOIRc.esm.js";
3
- import { c as createSession } from "./session-CUh77zj3.esm.js";
4
- import "./BrowserEnvironmentProvider-DaHeLJQw.esm.js";
5
- import "./browserSimulation-B4ubb2OL.esm.js";
6
- import { t as getFinishStatus } from "./flowCompletionService-B5JemmC6.esm.js";
1
+ import "./api-CqKwkjJ3.esm.js";
2
+ import "./events-CZ2ka3pu.esm.js";
3
+ import { c as createSession } from "./session-DoI-X9FK.esm.js";
4
+ import "./BrowserEnvironmentProvider-lxn4oxXn.esm.js";
5
+ import "./browserSimulation-7W5-A3RV.esm.js";
6
+ import { t as getFinishStatus } from "./flowCompletionService-W6bj7Xd3.esm.js";
7
7
 
8
8
  export { createSession, getFinishStatus };
@@ -1,8 +1,8 @@
1
- import { n as warmupWasm } from "./BaseWasmProvider-D-s_6M5H.esm.js";
2
- import { t as WasmUtilProvider } from "./WasmUtilProvider-BpZSvZbg.esm.js";
3
- import { a as resetApi, o as setClient, s as setToken } from "./api-DzpnV6O7.esm.js";
4
- import { h as flushEventQueue } from "./events-DlHrOIRc.esm.js";
5
- import { i as resetSessionInit, r as initializeSession } from "./session-CUh77zj3.esm.js";
1
+ import { n as warmupWasm } from "./BaseWasmProvider-C73c2nV9.esm.js";
2
+ import { t as WasmUtilProvider } from "./WasmUtilProvider-DRh0wrlm.esm.js";
3
+ import { a as resetApi, o as setClient, s as setToken } from "./api-CqKwkjJ3.esm.js";
4
+ import { h as flushEventQueue } from "./events-CZ2ka3pu.esm.js";
5
+ import { i as resetSessionInit, r as initializeSession } from "./session-DoI-X9FK.esm.js";
6
6
 
7
7
  //#region ../infra/src/http/createApi.ts
8
8
  var FetchHttpError = class extends Error {
@@ -386,6 +386,7 @@ async function setup(options) {
386
386
  if (options.token) {
387
387
  setToken(options.token);
388
388
  flushEventQueue();
389
+ resetSessionInit();
389
390
  initializeSession({ hostingApp: options.hostingApp }).catch((error) => {
390
391
  console.warn("Session initialization failed:", error);
391
392
  });
@@ -1,4 +1,4 @@
1
- import { n as WasmPipeline } from "./warmup-CIj_wEV_.js";
1
+ import { n as WasmPipeline } from "./warmup-Cs0uqxUW.js";
2
2
 
3
3
  //#region src/setup.d.ts
4
4
 
@@ -1,5 +1,5 @@
1
- import { t as Manager } from "./Manager-BN2g_I8W.js";
2
- import "./Actor-Ba71-_30.js";
1
+ import { t as Manager } from "./Manager-Bcnemkyi.js";
2
+ import "./Actor-BkPcZGke.js";
3
3
 
4
4
  //#region src/modules/signature/types.d.ts
5
5
  /**
@@ -15,8 +15,9 @@ type SignatureConfig = {
15
15
  title?: string;
16
16
  /**
17
17
  * Optional subtitle for both steps. When omitted, the UI uses the default finger/mouse copy.
18
+ * Backend field name: `subTitle` (capital T).
18
19
  */
19
- subtitle?: string;
20
+ subTitle?: string;
20
21
  /**
21
22
  * When true, uploads base64 via Omni `addSignature` v2 JSON body.
22
23
  * When false (default), uploads JPEG bytes (`image/jpeg`).