@incodetech/core 0.0.0-dev-20260911-aec162f0 → 0.0.0-dev-20260914-8aef7789

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 (118) hide show
  1. package/dist/{FaceDetectionProvider-Cn1wS-sA.d.ts → BaseWasmProvider-CO0GfaHM.d.ts} +7 -37
  2. package/dist/{BrowserDiagnosticsCryptoProvider-8sT0QLgq.esm.js → BrowserDiagnosticsCryptoProvider-BoYzmYY5.esm.js} +1 -1
  3. package/dist/{onDeviceFaceResults-hle2Ci9l.esm.js → FaceDetectionProvider-0bWjPgW5.esm.js} +219 -340
  4. package/dist/FaceDetectionProvider-CyLxkzRP.d.ts +36 -0
  5. package/dist/{IIdCaptureCapability-DDWlQzhi.d.ts → IIdCaptureCapability-nfpic2z2.d.ts} +7 -3
  6. package/dist/{IWasmUtilCapability-SNPhmIwB.d.ts → IWasmUtilCapability-DaP6pfHq.d.ts} +10 -4
  7. package/dist/{MotionSensorProvider-Vlyhbcty.esm.js → MotionSensorProvider-BnZ8_1Sk.esm.js} +1 -1
  8. package/dist/{StreamCanvasCapture-D2XcXCZ4.esm.js → StreamCanvasCapture-C9jtgBdT.esm.js} +2 -2
  9. package/dist/{deepsightService-MZOpj7Vp.d.ts → StreamCanvasCapture-D9Dz8kqB.d.ts} +54 -41
  10. package/dist/ae-signature.esm.js +1 -1
  11. package/dist/{apiError-XdhqSAmg.esm.js → apiError-CixFeCyt.esm.js} +1 -1
  12. package/dist/authentication.d.ts +3 -3
  13. package/dist/authentication.esm.js +2 -2
  14. package/dist/{authenticationManager-DqBOkMzk.esm.js → authenticationManager-CN26fkJa.esm.js} +4 -4
  15. package/dist/{authenticationManager-BCkV6CSG.d.ts → authenticationManager-D7UUqgnN.d.ts} +1 -1
  16. package/dist/{authenticationStateMachine-Cto_G5bN.esm.js → authenticationStateMachine-CUXpIxAD.esm.js} +6 -62
  17. package/dist/avatar.d.ts +1 -1
  18. package/dist/avatar.esm.js +1 -1
  19. package/dist/{backCameraStream-DE_5qY04.esm.js → backCameraStream-BOtyQowf.esm.js} +75 -18
  20. package/dist/{camera-_2sXMXiF.esm.js → camera-sIa9ceW2.esm.js} +19 -1
  21. package/dist/camera.esm.js +1 -1
  22. package/dist/{canvas-E1zGkel4.esm.js → canvas-BxFzWTt-.esm.js} +19 -0
  23. package/dist/createCameraCycleOwnership-DQ5-F2oW.esm.js +826 -0
  24. package/dist/{createFaceAvatar-DQKaRise.esm.js → createFaceAvatar-BNHdeFj8.esm.js} +2 -2
  25. package/dist/{createFaceAvatar-pUEkdk4X.d.ts → createFaceAvatar-CTM9aj9Q.d.ts} +12 -6
  26. package/dist/curp-validation.d.ts +1 -1
  27. package/dist/{curpValidationManager-cSd2MrOQ.d.ts → curpValidationManager-CTJB2RsD.d.ts} +1 -1
  28. package/dist/{deepsightLoader-Dwr1zKFa.esm.js → deepsightLoader-Dhz9T_KJ.esm.js} +19 -53
  29. package/dist/document-capture.esm.js +2 -2
  30. package/dist/{documentCaptureManager-BTpHZMgW.esm.js → documentCaptureManager-BwcbMwo5.esm.js} +1 -1
  31. package/dist/{documentCaptureStateMachine-CPizkpcg.esm.js → documentCaptureStateMachine-F8SCOtL_.esm.js} +4 -4
  32. package/dist/dynamic-forms.esm.js +2 -2
  33. package/dist/{dynamicFormsManager-Cmh84Nz4.esm.js → dynamicFormsManager-CNBrBOR3.esm.js} +1 -1
  34. package/dist/{dynamicFormsStateMachine-DZr7Ugvy.esm.js → dynamicFormsStateMachine-Bo2qrjHB.esm.js} +1 -1
  35. package/dist/ekyb.d.ts +1 -1
  36. package/dist/ekyb.esm.js +3 -3
  37. package/dist/{ekybManager-Dc2tT9fu.esm.js → ekybManager-D8DdfRAD.esm.js} +1 -1
  38. package/dist/{ekybStateMachine-GSEMOiHn.esm.js → ekybStateMachine-oPCbEFob.esm.js} +1 -1
  39. package/dist/electronic-signature.esm.js +1 -1
  40. package/dist/{electronicSignatureManager-CpLuqw7T.esm.js → electronicSignatureManager-DkKQ07vx.esm.js} +1 -1
  41. package/dist/extensibility.d.ts +11 -58
  42. package/dist/extensibility.esm.js +13 -13
  43. package/dist/{faceCaptureManagerFactory-kDmbL0I7.esm.js → faceCaptureManagerFactory-D_EjQnnE.esm.js} +19 -4
  44. package/dist/{faceCaptureManagerFactory-CzUr_ZPq.d.ts → faceCaptureManagerFactory-DqrYpjA5.d.ts} +24 -12
  45. package/dist/{faceCaptureSetup-CAGBnLVx.esm.js → faceCaptureSetup-WeO8-TfR.esm.js} +999 -382
  46. package/dist/{feature-management-B6CtmH1O.esm.js → feature-management-BEqf3Sr3.esm.js} +1 -1
  47. package/dist/feature-management.esm.js +1 -1
  48. package/dist/fiscal-qr.esm.js +1 -1
  49. package/dist/{fiscalQrManager-DI6uOffY.esm.js → fiscalQrManager-Bp_-3LJr.esm.js} +3 -3
  50. package/dist/flow-events.d.ts +1 -1
  51. package/dist/flow.d.ts +6 -6
  52. package/dist/flow.esm.js +3 -3
  53. package/dist/{flowCompletionService-BpoZDpAn.esm.js → flowCompletionService-DELbVeL5.esm.js} +1 -1
  54. package/dist/{flowServices-BVnSStkh.esm.js → flowServices-Brr2fh_c.esm.js} +5 -5
  55. package/dist/geolocation.esm.js +2 -2
  56. package/dist/{geolocationManager-CLm86P8G.esm.js → geolocationManager-CtVZDjng.esm.js} +1 -1
  57. package/dist/{geolocationStateMachine-Bi3vy7Wl.esm.js → geolocationStateMachine-tjsYcMhr.esm.js} +1 -1
  58. package/dist/home.d.ts +1 -1
  59. package/dist/id-selfie-flow.d.ts +3 -3
  60. package/dist/id-selfie-flow.esm.js +10 -10
  61. package/dist/id.d.ts +4 -4
  62. package/dist/id.esm.js +35 -44
  63. package/dist/{idCaptureDefaults-BLsd7shz.esm.js → idCaptureDefaults-C66YvkgN.esm.js} +19 -14
  64. package/dist/{idCaptureManager-DW1GeEUk.d.ts → idCaptureManager-DE_jyr5X.d.ts} +98 -37
  65. package/dist/{idCaptureManager-BUTdcmaD.esm.js → idCaptureManager-zjul9YdZ.esm.js} +27 -17
  66. package/dist/{idCaptureServices-fzIhBqAK.esm.js → idCaptureServices-UXYCBZPK.esm.js} +80 -20
  67. package/dist/{idCaptureStateMachine-Cp2_revF.esm.js → idCaptureStateMachine-D3pqfK2Z.esm.js} +1954 -1082
  68. package/dist/{index-1PoJuUJ-.d.ts → index-BGxFwnld.d.ts} +1 -1
  69. package/dist/index.d.ts +1 -1
  70. package/dist/index.esm.js +1 -1
  71. package/dist/mandatory-consent.d.ts +2 -2
  72. package/dist/{mandatoryConsentManager-BJnylLZO.d.ts → mandatoryConsentManager-CZwhsUlO.d.ts} +1 -1
  73. package/dist/{permissionGuards-DxbvOoZJ.esm.js → permissionGuards-o1JLtewE.esm.js} +1 -1
  74. package/dist/{permissionServices-f7nBnW5P.esm.js → permissionServices-7lzEiOsO.esm.js} +3 -3
  75. package/dist/personhood.d.ts +5 -5
  76. package/dist/personhood.esm.js +8 -8
  77. package/dist/qe-signature.esm.js +1 -1
  78. package/dist/{runChildModule-BPlX2IDO.esm.js → runChildModule-BDlvNMrA.esm.js} +1 -1
  79. package/dist/{safeStorage-Dp9m6aOh.esm.js → safeStorage-1O9k0ulP.esm.js} +8 -8
  80. package/dist/{sdkVersion-Dr9_E3d9.esm.js → sdkVersion-CS_0s_Lc.esm.js} +1 -1
  81. package/dist/selfie.d.ts +4 -4
  82. package/dist/selfie.esm.js +12 -74
  83. package/dist/{selfieManager-BdP-RgH4.esm.js → selfieManager-BouB9yUQ.esm.js} +4 -4
  84. package/dist/{selfieManager-Bg_Xwe4p.d.ts → selfieManager-DZ3u_WN9.d.ts} +1 -1
  85. package/dist/{selfieStateMachine-B8vFeT39.esm.js → selfieStateMachine-TGfI9hNp.esm.js} +22 -31
  86. package/dist/{session-C2THUsQZ.esm.js → session-m9j27bHm.esm.js} +3 -3
  87. package/dist/session.d.ts +1 -1
  88. package/dist/session.esm.js +4 -4
  89. package/dist/{sessionInitializer-CEycxhm4.esm.js → sessionInitializer-CUpgbHzs.esm.js} +4 -4
  90. package/dist/{setup-D6yz9se2.d.ts → setup-CEX95gJ1.d.ts} +11 -6
  91. package/dist/{setup-BHJ3-fhX.esm.js → setup-CfNAVG-d.esm.js} +12 -11
  92. package/dist/{trueSightService-DLzYznkh.esm.js → trueSightService-TqmmYye3.esm.js} +4 -4
  93. package/dist/types-BhHF-CuL.d.ts +6 -0
  94. package/dist/{types-DJ2OM9rw.d.ts → types-BzuUebkB.d.ts} +1 -1
  95. package/dist/{types-DzmqFoCH.d.ts → types-CBctcPeF.d.ts} +1 -1
  96. package/dist/{types-BBI4-s9u2.d.ts → types-CoOlCUp82.d.ts} +5 -5
  97. package/dist/{types-hSqUyXyw.d.ts → types-DL0CXuWv.d.ts} +3 -3
  98. package/dist/types-Ds928RiU.d.ts +1 -0
  99. package/dist/{types-_pWNFY1F.d.ts → types-eLtVBhon.d.ts} +1 -1
  100. package/dist/video-selfie.d.ts +3 -3
  101. package/dist/video-selfie.esm.js +5 -5
  102. package/dist/{videoSelfieCameraWarmer-D5E12WjL.esm.js → videoSelfieCameraWarmer-C-cESczy.esm.js} +9 -9
  103. package/dist/{videoSelfieStepDetector-B8TvFDNK.d.ts → videoSelfieStepDetector-CdXIFh9s.d.ts} +4 -4
  104. package/dist/virtualCameraCheck-WOloJ-do.esm.js +48 -0
  105. package/dist/{warmup-BOM-sD-6.esm.js → warmup-CUUnwYxe.esm.js} +282 -90
  106. package/dist/{warmup-CXHBgvFC.d.ts → warmup-Cis2p6O0.d.ts} +13 -2
  107. package/dist/wasm.d.ts +9 -3
  108. package/dist/wasm.esm.js +10 -4
  109. package/dist/{wasmDsFlagSync-C3k_VK9o.esm.js → wasmDsFlagSync-BJtLh2XK.esm.js} +1 -1
  110. package/dist/{wasmWebClient-BJCaFeBL.esm.js → wasmWebClient-B7baE-Wf.esm.js} +223 -2
  111. package/dist/workflow.d.ts +1 -1
  112. package/dist/workflow.esm.js +15 -15
  113. package/package.json +1 -1
  114. package/dist/imageFile-CLaua6xO.esm.js +0 -69
  115. package/dist/types-m4t_cT5J.d.ts +0 -6
  116. package/dist/{Face2DProvider-UUQt_vRC.esm.js → Face2DProvider-BF48sz5c.esm.js} +1 -1
  117. package/dist/{PrivacyLensProvider-D8PS7AJa.esm.js → PrivacyLensProvider-EwnC_C5n.esm.js} +1 -1
  118. package/dist/{selfieErrorUtils-C6gC06J7.esm.js → selfieErrorUtils-C77GXJH6.esm.js} +1 -1
@@ -2,6 +2,7 @@
2
2
  const WASM_MODEL_FILES = {
3
3
  idCapture: "id_capture_2_01_fp16.ortmodelv2",
4
4
  idFiqa: "id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2",
5
+ idFaceDetector: "id_facedetector_v2_1_fp16.ortmodelv2",
5
6
  barcode: "barcode_enhance_896x224_fp16.ortmodelv2",
6
7
  selfie: "selfie_bf_angles_192x192_opset9_fp16.ortmodelv2",
7
8
  faceAttributes: "face_attributes_v1_3_fp16.ortmodelv2",
@@ -41,6 +42,40 @@ const WASM_PIPELINE_LAZY_MODEL_NAMES = {
41
42
  videoSelfie: [],
42
43
  videoSelfieId: []
43
44
  };
45
+ /**
46
+ * Models a pipeline's Core workflow profiles can use but that a pre-existing
47
+ * self-hosted configuration is NOT required to supply. Deliberately not part of
48
+ * `defineWasm`'s required set: adding a model to a released pipeline's required
49
+ * list is a breaking change for every self-hoster following the published
50
+ * WASM-Configuration walkthrough. When an optional model is absent, warmup skips
51
+ * the Core profile that needs it instead of failing.
52
+ */
53
+ const WASM_PIPELINE_OPTIONAL_MODEL_NAMES = {
54
+ selfie: [],
55
+ onDeviceSelfie: [],
56
+ idCapture: ["idFaceDetector"],
57
+ videoSelfie: [],
58
+ videoSelfieId: []
59
+ };
60
+ const MODEL_VARIANT_DIRECTORIES = ["current", "legacy"];
61
+ /**
62
+ * ml-wasm-kit publishes every model twice under a release's `models/`
63
+ * directory: `models/current/` pairs with the SIMD binary, `models/legacy/`
64
+ * with the non-SIMD fallback. Both URLs are built up front so the loader can
65
+ * pick one after the SIMD probe without rewriting strings — a base path is not
66
+ * required to contain a `models` segment, and the CDN answers a variant-less
67
+ * model path with a 200 HTML placeholder rather than a 404.
68
+ */
69
+ function buildModelVariantSources(modelsBasePath, fileName) {
70
+ let base = modelsBasePath;
71
+ while (base.endsWith("/")) base = base.slice(0, -1);
72
+ const lastSegment = base.slice(base.lastIndexOf("/") + 1);
73
+ if (MODEL_VARIANT_DIRECTORIES.includes(lastSegment)) return `${base}/${fileName}`;
74
+ return {
75
+ current: `${base}/current/${fileName}`,
76
+ legacy: `${base}/legacy/${fileName}`
77
+ };
78
+ }
44
79
  const WASM_PIPELINE_MODELS = {
45
80
  selfie: WASM_PIPELINE_MODEL_NAMES.selfie.map((model) => WASM_MODEL_FILES[model]),
46
81
  onDeviceSelfie: WASM_PIPELINE_MODEL_NAMES.onDeviceSelfie.map((model) => WASM_MODEL_FILES[model]),
@@ -173,6 +208,185 @@ var SemaphoreProvider = class {
173
208
  }
174
209
  };
175
210
  //#endregion
211
+ //#region ../infra/src/wasm/wasmStorageFallback.ts
212
+ /**
213
+ * SDK-local compatibility fallback for ml-wasm-kit releases whose embind
214
+ * storage lookups let browser `SecurityError`s escape into JavaScript.
215
+ *
216
+ * The fallback shadows only a denied `window.localStorage` or
217
+ * `window.sessionStorage` property. Available storage and absent/deleted
218
+ * globals are left untouched. A coordinator stored under `Symbol.for(...)`
219
+ * shares the memory stores and leases across multiple bundled SDK copies.
220
+ */
221
+ const STORAGE_NAMES = ["localStorage", "sessionStorage"];
222
+ const COORDINATOR_KEY = Symbol.for("@incodetech/infra/wasm-storage-fallback/v1");
223
+ const COORDINATOR_VERSION = 1;
224
+ const INSTALL_ERROR = "[Incode SDK] Unable to install the WASM in-memory storage fallback.";
225
+ let probeSequence = 0;
226
+ function createMemoryStorage() {
227
+ const values = /* @__PURE__ */ new Map();
228
+ return {
229
+ get length() {
230
+ return values.size;
231
+ },
232
+ clear() {
233
+ values.clear();
234
+ },
235
+ getItem(key) {
236
+ return values.get(String(key)) ?? null;
237
+ },
238
+ key(index) {
239
+ return Array.from(values.keys())[Number(index)] ?? null;
240
+ },
241
+ removeItem(key) {
242
+ values.delete(String(key));
243
+ },
244
+ setItem(key, value) {
245
+ values.set(String(key), String(value));
246
+ }
247
+ };
248
+ }
249
+ function isDeniedStorageError(error) {
250
+ if (typeof error !== "object" || error === null || !("name" in error)) return false;
251
+ const name = Reflect.get(error, "name");
252
+ return name === "SecurityError" || name === "QuotaExceededError";
253
+ }
254
+ function probeStorage(name) {
255
+ const descriptor = Object.getOwnPropertyDescriptor(window, name);
256
+ let storage;
257
+ try {
258
+ storage = window[name];
259
+ } catch (error) {
260
+ if (isDeniedStorageError(error)) return {
261
+ status: "denied",
262
+ descriptor
263
+ };
264
+ throw error;
265
+ }
266
+ if (storage == null) return { status: "absent" };
267
+ probeSequence += 1;
268
+ const key = `__incode_wasm_storage_probe_${Date.now()}_${probeSequence}`;
269
+ try {
270
+ storage.setItem(key, key);
271
+ if (storage.getItem(key) !== key) throw new DOMException("Storage probe did not retain its value.", "SecurityError");
272
+ storage.removeItem(key);
273
+ return { status: "available" };
274
+ } catch (error) {
275
+ try {
276
+ storage.removeItem(key);
277
+ } catch {}
278
+ if (isDeniedStorageError(error)) return {
279
+ status: "denied",
280
+ descriptor
281
+ };
282
+ throw error;
283
+ }
284
+ }
285
+ function isCoordinator(value) {
286
+ return typeof value === "object" && value !== null && Reflect.get(value, "version") === COORDINATOR_VERSION && Reflect.get(value, "leases") instanceof Set && Reflect.get(value, "shadows") instanceof Map;
287
+ }
288
+ function readCoordinator() {
289
+ const value = Reflect.get(window, COORDINATOR_KEY);
290
+ if (value === void 0) return null;
291
+ if (!isCoordinator(value)) throw new Error(INSTALL_ERROR);
292
+ return value;
293
+ }
294
+ function restoreShadow(name, shadow) {
295
+ if (Object.getOwnPropertyDescriptor(window, name)?.get !== shadow.installedGetter) return;
296
+ if (shadow.originalDescriptor) Object.defineProperty(window, name, shadow.originalDescriptor);
297
+ else Reflect.deleteProperty(window, name);
298
+ }
299
+ function installDeniedShadows(coordinator) {
300
+ const installed = [];
301
+ try {
302
+ for (const name of STORAGE_NAMES) {
303
+ if (coordinator.shadows.has(name)) continue;
304
+ const probe = probeStorage(name);
305
+ if (probe.status !== "denied") continue;
306
+ if (probe.descriptor && !probe.descriptor.configurable) throw new Error(INSTALL_ERROR);
307
+ const memory = createMemoryStorage();
308
+ const installedGetter = () => memory;
309
+ const shadow = {
310
+ originalDescriptor: probe.descriptor,
311
+ installedGetter,
312
+ memory
313
+ };
314
+ Object.defineProperty(window, name, {
315
+ configurable: true,
316
+ enumerable: probe.descriptor?.enumerable ?? true,
317
+ get: installedGetter
318
+ });
319
+ coordinator.shadows.set(name, shadow);
320
+ installed.push(name);
321
+ }
322
+ return installed;
323
+ } catch (error) {
324
+ for (const name of installed.reverse()) {
325
+ const shadow = coordinator.shadows.get(name);
326
+ coordinator.shadows.delete(name);
327
+ if (shadow) {
328
+ restoreShadow(name, shadow);
329
+ shadow.memory.clear();
330
+ }
331
+ }
332
+ throw error;
333
+ }
334
+ }
335
+ function restoreCoordinator(coordinator) {
336
+ let firstError;
337
+ for (const [name, shadow] of coordinator.shadows) {
338
+ try {
339
+ restoreShadow(name, shadow);
340
+ } catch (error) {
341
+ firstError ??= error;
342
+ }
343
+ shadow.memory.clear();
344
+ }
345
+ coordinator.shadows.clear();
346
+ if (Reflect.get(window, COORDINATOR_KEY) === coordinator) Reflect.deleteProperty(window, COORDINATOR_KEY);
347
+ if (firstError !== void 0) throw firstError;
348
+ }
349
+ /**
350
+ * Acquires a shared fallback lease when storage access is denied.
351
+ *
352
+ * The caller must retain the lease for the complete native-handle lifetime;
353
+ * ml-wasm-kit performs storage lookups during constructors and later calls.
354
+ */
355
+ function acquireWasmStorageFallback() {
356
+ if (typeof window === "undefined") return null;
357
+ let coordinator = readCoordinator();
358
+ const created = coordinator === null;
359
+ coordinator ??= {
360
+ version: COORDINATOR_VERSION,
361
+ leases: /* @__PURE__ */ new Set(),
362
+ shadows: /* @__PURE__ */ new Map()
363
+ };
364
+ if (created) Object.defineProperty(window, COORDINATOR_KEY, {
365
+ configurable: true,
366
+ enumerable: false,
367
+ value: coordinator
368
+ });
369
+ try {
370
+ installDeniedShadows(coordinator);
371
+ } catch (error) {
372
+ if (created) Reflect.deleteProperty(window, COORDINATOR_KEY);
373
+ throw error;
374
+ }
375
+ if (coordinator.shadows.size === 0) {
376
+ if (created) Reflect.deleteProperty(window, COORDINATOR_KEY);
377
+ return null;
378
+ }
379
+ const token = Symbol("wasm-storage-fallback-lease");
380
+ coordinator.leases.add(token);
381
+ let released = false;
382
+ return { release() {
383
+ if (released) return;
384
+ released = true;
385
+ coordinator.leases.delete(token);
386
+ if (coordinator.leases.size === 0) restoreCoordinator(coordinator);
387
+ } };
388
+ }
389
+ //#endregion
176
390
  //#region ../infra/src/wasm/apiUtilities.ts
177
391
  /**
178
392
  * Shared WASM module loader.
@@ -217,7 +431,7 @@ async function resolveGlue(loader, glueCodePath) {
217
431
  }
218
432
  async function instantiate(factory, libPath) {
219
433
  window.wasmArrayBuffer = await resolveWasmSource(libPath, "binary");
220
- return await factory();
434
+ return await factory({ wasmBinary: window.wasmArrayBuffer });
221
435
  }
222
436
  /**
223
437
  * Load the WASM module, memoized. Subsequent calls return the same instance.
@@ -231,7 +445,9 @@ async function loadWasmModule(config) {
231
445
  if (loadedResult) return loadedResult;
232
446
  if (loadPromise) return loadPromise;
233
447
  loadPromise = (async () => {
448
+ let storageFallbackLease = null;
234
449
  try {
450
+ storageFallbackLease = acquireWasmStorageFallback();
235
451
  const wantSimd = config.useSimd !== false;
236
452
  const simdBinary = config.wasmSimdPath ?? config.wasmPath;
237
453
  if (wantSimd && simdBinary !== config.wasmPath) try {
@@ -257,6 +473,8 @@ async function loadWasmModule(config) {
257
473
  } catch (error) {
258
474
  loadPromise = null;
259
475
  throw error;
476
+ } finally {
477
+ storageFallbackLease?.release();
260
478
  }
261
479
  })();
262
480
  return loadPromise;
@@ -397,12 +615,15 @@ async function initializeWasmWebClient(config) {
397
615
  if (webClientApi) return;
398
616
  if (initPromise) return initPromise;
399
617
  initPromise = (async () => {
618
+ let acquiredStorageFallbackLease = null;
400
619
  try {
620
+ acquiredStorageFallbackLease = acquireWasmStorageFallback();
401
621
  const { wasmModule } = await loadWasmModule(config);
402
622
  if (!isWebClientWasm(wasmModule)) throw new Error("WASM module does not expose a WebClient class. Update webLib.wasm to a build that includes WebClient.");
403
623
  webClientApi = new wasmModule.WebClient();
404
624
  } catch (error) {
405
625
  initPromise = null;
626
+ acquiredStorageFallbackLease?.release();
406
627
  throw error;
407
628
  }
408
629
  })();
@@ -513,4 +734,4 @@ function ensureReady() {
513
734
  return webClientApi;
514
735
  }
515
736
  //#endregion
516
- export { resolveWasmSource as _, setWebApiHttpTransport as a, wasmCallWrapper as c, deriveSiblingJsPath as d, WASM_MODEL_FILES as f, missingWasmModelError as g, WASM_PIPELINE_MODEL_NAMES as h, initializeWasmWebClient as i, loadWasmModule as l, WASM_PIPELINE_MODELS as m, createWebApiHostAdapter as n, setupWasmConnection as o, WASM_PIPELINE_LAZY_MODEL_NAMES as p, executeWasmRequest as r, ML_CALL_MAX_POLLS as s, WasmWebClientError as t, SemaphoreProvider as u };
737
+ export { WASM_PIPELINE_OPTIONAL_MODEL_NAMES as _, setWebApiHttpTransport as a, resolveWasmSource as b, wasmCallWrapper as c, SemaphoreProvider as d, deriveSiblingJsPath as f, WASM_PIPELINE_MODEL_NAMES as g, WASM_PIPELINE_MODELS as h, initializeWasmWebClient as i, loadWasmModule as l, WASM_PIPELINE_LAZY_MODEL_NAMES as m, createWebApiHostAdapter as n, setupWasmConnection as o, WASM_MODEL_FILES as p, executeWasmRequest as r, ML_CALL_MAX_POLLS as s, WasmWebClientError as t, acquireWasmStorageFallback as u, buildModelVariantSources as v, missingWasmModelError as y };
@@ -3,7 +3,7 @@ import { t as CallbackActorLogic } from "./callback-645_omgz.js";
3
3
  import "./StateMachine-EDpYWy0i.js";
4
4
  import { t as Manager } from "./Manager-CQQ99QOI.js";
5
5
  import { a as TotalScore, i as GetTotalScoreStatusFn, n as FinishStatus, r as GetFinishStatusFn } from "./flowCompletionService-BlAHsKyv.js";
6
- import { o as FlowEventSubscribable } from "./index-1PoJuUJ-.js";
6
+ import { o as FlowEventSubscribable } from "./index-BGxFwnld.js";
7
7
  import { a as WorkflowModuleRegistry, i as RunChildModuleInput, r as RunChildModuleEvent, t as ModuleConfigMappers } from "./types-BfgmV7s7.js";
8
8
  //#region src/modules/workflow/types.d.ts
9
9
  /** Possible node types returned by the workflow server. */
@@ -1,29 +1,29 @@
1
- import { E as updateFeatureManagementUser } from "./feature-management-B6CtmH1O.esm.js";
1
+ import { E as updateFeatureManagementUser } from "./feature-management-BEqf3Sr3.esm.js";
2
2
  import { t as api } from "./api-Bx3gKW_y.esm.js";
3
- import { l as trueSightLog } from "./trueSightService-DLzYznkh.esm.js";
3
+ import { l as trueSightLog } from "./trueSightService-TqmmYye3.esm.js";
4
4
  import { n as eventModuleNames, o as createManagerInstrumentation, v as addEvent } from "./events-ijlbX_Wx.esm.js";
5
- import { i as initializeSession, r as getSessionFingerprintResult } from "./sessionInitializer-CEycxhm4.esm.js";
5
+ import { i as initializeSession, r as getSessionFingerprintResult } from "./sessionInitializer-CUpgbHzs.esm.js";
6
6
  import { t as endpoints } from "./endpoints-D3B9mUHh.esm.js";
7
- import { i as toIncodeApiError } from "./apiError-XdhqSAmg.esm.js";
8
- import { v as toEkybConfig } from "./flowServices-BVnSStkh.esm.js";
7
+ import { i as toIncodeApiError } from "./apiError-CixFeCyt.esm.js";
8
+ import { v as toEkybConfig } from "./flowServices-Brr2fh_c.esm.js";
9
9
  import { i as toEkycConfig } from "./ekycUtils-Dew1rBG0.esm.js";
10
10
  import { i as assign, s as createActor, t as setup, u as createManager } from "./xstate.esm-BuFLFuzz.esm.js";
11
11
  import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
12
- import { r as electronicSignatureMachine } from "./electronicSignatureManager-CpLuqw7T.esm.js";
12
+ import { r as electronicSignatureMachine } from "./electronicSignatureManager-DkKQ07vx.esm.js";
13
13
  import "./ae-signature.esm.js";
14
14
  import { t as antifraudMachine } from "./antifraudStateMachine-BHxehiJZ.esm.js";
15
- import { t as authenticationMachine } from "./authenticationStateMachine-Cto_G5bN.esm.js";
15
+ import { t as authenticationMachine } from "./authenticationStateMachine-CUXpIxAD.esm.js";
16
16
  import { t as certificateIssuanceMachine } from "./certificateIssuanceStateMachine-BBD5h8c4.esm.js";
17
17
  import { t as consentMachine } from "./consentStateMachine-DbUmqWgV.esm.js";
18
18
  import { t as curpValidationMachine } from "./curpValidationStateMachine-DvUPC_8S.esm.js";
19
19
  import { t as customWatchlistMachine } from "./customWatchlistStateMachine-qZVgkKgP.esm.js";
20
- import { t as documentCaptureMachine } from "./documentCaptureStateMachine-CPizkpcg.esm.js";
21
- import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-DZr7Ugvy.esm.js";
22
- import { t as ekybMachine } from "./ekybStateMachine-GSEMOiHn.esm.js";
20
+ import { t as documentCaptureMachine } from "./documentCaptureStateMachine-F8SCOtL_.esm.js";
21
+ import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-Bo2qrjHB.esm.js";
22
+ import { t as ekybMachine } from "./ekybStateMachine-oPCbEFob.esm.js";
23
23
  import { t as ekycMachine } from "./ekycStateMachine-CmdW2gVm.esm.js";
24
24
  import { t as emailMachine } from "./emailStateMachine-CyPFZ7dW.esm.js";
25
- import { t as selfieMachine } from "./selfieStateMachine-B8vFeT39.esm.js";
26
- import { t as idCaptureMachine } from "./idCaptureStateMachine-Cp2_revF.esm.js";
25
+ import { t as selfieMachine } from "./selfieStateMachine-TGfI9hNp.esm.js";
26
+ import { t as idCaptureMachine } from "./idCaptureStateMachine-D3pqfK2Z.esm.js";
27
27
  import { t as phoneMachine } from "./phoneStateMachine-jl8LJKCo.esm.js";
28
28
  import { t as watchlistMachine } from "./watchlistStateMachine-DvOby3a-.esm.js";
29
29
  import { t as watchlistForBusinessMachine } from "./watchlistForBusinessStateMachine-DEzgjz7C.esm.js";
@@ -32,12 +32,12 @@ import { t as mandatoryConsentMachine } from "./mandatoryConsentStateMachine-DSD
32
32
  import { t as idOcrStateMachine } from "./idOcrStateMachine-33UvRAHE.esm.js";
33
33
  import { n as redirectToMobileMachine } from "./redirectToMobileStateMachine-v3otpT-L.esm.js";
34
34
  import { t as signatureMachine } from "./signatureStateMachine-BHPwkJZS.esm.js";
35
- import { t as geolocationMachine } from "./geolocationStateMachine-Bi3vy7Wl.esm.js";
35
+ import { t as geolocationMachine } from "./geolocationStateMachine-tjsYcMhr.esm.js";
36
36
  import { t as governmentValidationMachine } from "./governmentValidationStateMachine-D1ZnEqdd.esm.js";
37
37
  import { t as idVerificationMachine } from "./idVerificationStateMachine-BPGrQZEm.esm.js";
38
38
  import { t as faceMatchMachine } from "./faceMatchStateMachine-BUc5FXYy.esm.js";
39
- import { n as getFinishStatus, r as getTotalScoreStatus } from "./flowCompletionService-BpoZDpAn.esm.js";
40
- import { n as attachFlowEventEmitter, t as runChildModule } from "./runChildModule-BPlX2IDO.esm.js";
39
+ import { n as getFinishStatus, r as getTotalScoreStatus } from "./flowCompletionService-DELbVeL5.esm.js";
40
+ import { n as attachFlowEventEmitter, t as runChildModule } from "./runChildModule-BDlvNMrA.esm.js";
41
41
  import { n as isAdvanceableError } from "./advanceableErrors-CpF2cBy6.esm.js";
42
42
  import "./qe-signature.esm.js";
43
43
  import { t as videoSelfieFlowModuleMachine } from "./videoSelfieFlowModuleMachine-BUe2uACW.esm.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incodetech/core",
3
- "version": "0.0.0-dev-20260911-aec162f0",
3
+ "version": "0.0.0-dev-20260914-8aef7789",
4
4
  "license": "ISC",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,69 +0,0 @@
1
- import { t as api } from "./api-Bx3gKW_y.esm.js";
2
- import { t as endpoints } from "./endpoints-D3B9mUHh.esm.js";
3
- //#region src/internal/manualReview/manualReviewService.ts
4
- async function flagFaceManualReview() {
5
- try {
6
- await api.put(endpoints.updateSession, { manualSelfieCheckNeeded: true });
7
- } catch {}
8
- }
9
- async function flagIdManualReview() {
10
- try {
11
- await api.put(endpoints.updateSession, { manualIdCheckNeeded: true });
12
- } catch {}
13
- }
14
- //#endregion
15
- //#region ../infra/src/media/imageFile.ts
16
- const DEFAULT_IMAGE_MIME_TYPE = "image/jpeg";
17
- const DEFAULT_IMAGE_QUALITY = .92;
18
- const canNormalizeImageFile = (file) => file.type.startsWith("image/") && typeof document !== "undefined" && typeof Image !== "undefined" && typeof URL !== "undefined" && typeof URL.createObjectURL === "function";
19
- const readFileAsDataUrl = (file) => new Promise((resolve, reject) => {
20
- const reader = new FileReader();
21
- reader.onload = () => {
22
- const result = reader.result;
23
- if (typeof result === "string") {
24
- resolve(result);
25
- return;
26
- }
27
- reject(/* @__PURE__ */ new Error("FileReader produced non-string result"));
28
- };
29
- reader.onerror = () => {
30
- reject(reader.error ?? /* @__PURE__ */ new Error("FileReader failed"));
31
- };
32
- reader.readAsDataURL(file);
33
- });
34
- const loadImage = (url) => new Promise((resolve, reject) => {
35
- const image = new Image();
36
- image.onload = () => resolve(image);
37
- image.onerror = () => reject(/* @__PURE__ */ new Error("Image decoding failed"));
38
- image.src = url;
39
- });
40
- const fileToCanvasDataUrl = async (file, options) => {
41
- const objectUrl = URL.createObjectURL(file);
42
- try {
43
- const image = await loadImage(objectUrl);
44
- const width = image.naturalWidth || image.width;
45
- const height = image.naturalHeight || image.height;
46
- if (width <= 0 || height <= 0) return readFileAsDataUrl(file);
47
- const canvas = document.createElement("canvas");
48
- canvas.width = width;
49
- canvas.height = height;
50
- const context = canvas.getContext("2d");
51
- if (!context) return readFileAsDataUrl(file);
52
- context.fillStyle = "#fff";
53
- context.fillRect(0, 0, width, height);
54
- context.drawImage(image, 0, 0, width, height);
55
- return canvas.toDataURL(options.mimeType ?? DEFAULT_IMAGE_MIME_TYPE, options.quality ?? DEFAULT_IMAGE_QUALITY);
56
- } finally {
57
- URL.revokeObjectURL(objectUrl);
58
- }
59
- };
60
- const imageFileToDataUrl = async (file, options = {}) => {
61
- if (!canNormalizeImageFile(file)) return readFileAsDataUrl(file);
62
- try {
63
- return await fileToCanvasDataUrl(file, options);
64
- } catch {
65
- return readFileAsDataUrl(file);
66
- }
67
- };
68
- //#endregion
69
- export { flagFaceManualReview as n, flagIdManualReview as r, imageFileToDataUrl as t };
@@ -1,6 +0,0 @@
1
- import { i as FlowModuleConfig } from "./types-DzmqFoCH.js";
2
- import { t as BaseFaceCaptureConfig } from "./types-hSqUyXyw.js";
3
- //#region src/modules/authentication/types.d.ts
4
- type AuthenticationConfig = FlowModuleConfig['AUTHENTICATION'] & BaseFaceCaptureConfig;
5
- //#endregion
6
- export { AuthenticationConfig as t };
@@ -1,5 +1,5 @@
1
- import { t as createHiddenVideoElement } from "./video-BtSWtHy1.esm.js";
2
1
  import { a as publishAvatarStats, r as isAvatarStatsEnabled, t as createAvatarStatsReporter } from "./avatarStats-CdUOb3VD.esm.js";
2
+ import { t as createHiddenVideoElement } from "./video-BtSWtHy1.esm.js";
3
3
  import { n as createFaceLandmarker, t as asRvfc } from "./mediapipeShared-B6oNoXEQ.esm.js";
4
4
  import { i as detectWorkerSourceInstrumentation, o as createFramePacer, r as createTrackProcessor } from "./privacyLensWorker-DI-Rg83h.esm.js";
5
5
  import { a as createAvatar2DPoseCore, c as SatinSmileyRenderer, i as AVATAR2D_POSE_CORE_DEFAULTS, l as resolveAvatar2DAssets, n as buildAvatar2DTrackWorkerSource, o as createAvatar2DPoseCoreDeps, r as canUseAvatar2DWorker, s as extractCompactFace, t as buildAvatar2DRenderWorkerSource, takeWarmAvatar2DWorker } from "./avatar2dWarm-DqucNFX4.esm.js";
@@ -1,5 +1,5 @@
1
- import { t as createHiddenVideoElement } from "./video-BtSWtHy1.esm.js";
2
1
  import { a as publishAvatarStats, r as isAvatarStatsEnabled, t as createAvatarStatsReporter } from "./avatarStats-CdUOb3VD.esm.js";
2
+ import { t as createHiddenVideoElement } from "./video-BtSWtHy1.esm.js";
3
3
  import { a as createPrivacyLensGl, i as detectWorkerSourceInstrumentation, n as canUsePrivacyLensWorker, o as createFramePacer, r as createTrackProcessor, t as buildPrivacyLensWorkerSource } from "./privacyLensWorker-DI-Rg83h.esm.js";
4
4
  //#region ../infra/src/avatar/privacy-lens/privacyLensShaders.ts
5
5
  /** Starting point; tuned live via the privacy-lens demo sliders. */
@@ -1,8 +1,8 @@
1
1
  import { t as api } from "./api-Bx3gKW_y.esm.js";
2
2
  import { t as endpoints } from "./endpoints-D3B9mUHh.esm.js";
3
3
  import { t as addDeviceStats } from "./stats-DkK-f8JT.esm.js";
4
- import { t as getDeviceClass } from "./getDeviceClass-5NYZg9s6.esm.js";
5
4
  import { t as FACE_ERROR_CODES } from "./types-BN5RPPIZ.esm.js";
5
+ import { t as getDeviceClass } from "./getDeviceClass-5NYZg9s6.esm.js";
6
6
  //#region src/modules/selfie/selfieUploadService.ts
7
7
  /**
8
8
  * Uploads a selfie image to the backend.