@incodetech/core 0.0.0-dev-20260421-b19fd5f → 0.0.0-dev-20260421-3d3274a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{OpenViduRecordingProvider-DUURuxGT.esm.js → OpenViduRecordingProvider-C10cvIv6.esm.js} +1 -1
- package/dist/{WasmUtilProvider-OnSlurfW.esm.js → WasmUtilProvider-DLgdRyEg.esm.js} +1 -1
- package/dist/{addressSearch-CBmh3AXP.esm.js → addressSearch-C6eGEbdK.esm.js} +4 -4
- package/dist/{ae-signature-BbRI5Qzn.esm.js → ae-signature-DvF-yLWx.esm.js} +1 -1
- package/dist/ae-signature.d.ts +3 -3
- package/dist/ae-signature.esm.js +5 -5
- package/dist/antifraud.d.ts +1 -1
- package/dist/antifraud.esm.js +4 -4
- package/dist/{antifraudStateMachine-CpwtQyX5.esm.js → antifraudStateMachine-BEP9IYFN.esm.js} +3 -3
- package/dist/authentication.d.ts +11 -11
- package/dist/authentication.esm.js +22 -22
- package/dist/{authenticationManager-C75RqUmN.d.ts → authenticationManager-BHwV3eyn.d.ts} +2 -2
- package/dist/{authenticationManager-CSUs5i1x.esm.js → authenticationManager-FMfiLmyj.esm.js} +6 -6
- package/dist/{authenticationStateMachine-CILXOYXS.esm.js → authenticationStateMachine-CeFBXnnM.esm.js} +6 -6
- package/dist/{backCameraStream-BXfdKlzB.esm.js → backCameraStream-BtLt5ZMq.esm.js} +3 -3
- package/dist/camera.d.ts +1 -1
- package/dist/camera.esm.js +3 -3
- package/dist/consent.d.ts +52 -52
- package/dist/consent.esm.js +4 -4
- package/dist/{consentStateMachine-DCDbjgLj.esm.js → consentStateMachine-DZTzztq9.esm.js} +3 -3
- package/dist/cross-document-data-match.d.ts +1 -1
- package/dist/cross-document-data-match.esm.js +4 -4
- package/dist/curp-validation.d.ts +5 -5
- package/dist/curp-validation.esm.js +4 -4
- package/dist/{curpValidationStateMachine-BURePwX5.esm.js → curpValidationStateMachine-BcVkABa_.esm.js} +3 -3
- package/dist/custom-fields.d.ts +115 -0
- package/dist/custom-fields.esm.js +197 -0
- package/dist/{deepsightLoader-BiqNFbbE.esm.js → deepsightLoader-CoBxhuhG.esm.js} +10 -10
- package/dist/{deepsightService-D8Kbc-41.d.ts → deepsightService-BaBzj_iP.d.ts} +2 -2
- package/dist/{deepsightService-Yfw6LCyd.esm.js → deepsightService-Df3Ad9a2.esm.js} +5 -5
- package/dist/device.esm.js +3 -3
- package/dist/document-capture.d.ts +79 -79
- package/dist/document-capture.esm.js +8 -8
- package/dist/document-upload.d.ts +53 -53
- package/dist/document-upload.esm.js +7 -7
- package/dist/{documentCaptureStateMachine-CCevSMgK.esm.js → documentCaptureStateMachine-AEeMd_sA.esm.js} +5 -5
- package/dist/ekyb.d.ts +3 -3
- package/dist/ekyb.esm.js +10 -10
- package/dist/{ekybStateMachine-CF4d_Fq4.esm.js → ekybStateMachine-LC7KeVbs.esm.js} +5 -5
- package/dist/ekyc.d.ts +3 -3
- package/dist/ekyc.esm.js +6 -6
- package/dist/{ekycStateMachine-CMkH73Rd.esm.js → ekycStateMachine-C_NGgk5Y.esm.js} +4 -4
- package/dist/electronic-signature.d.ts +3 -3
- package/dist/electronic-signature.esm.js +4 -4
- package/dist/{electronicSignatureManager-Cp450Tvy.esm.js → electronicSignatureManager-BHuZgDfX.esm.js} +3 -3
- package/dist/email.d.ts +3 -3
- package/dist/email.esm.js +6 -6
- package/dist/{emailManager-DZ1bKeHd.esm.js → emailManager-BbRpgtAL.esm.js} +3 -3
- package/dist/{emailManager-DXdv0T1X.d.ts → emailManager-qI_wqT4C.d.ts} +2 -2
- package/dist/{emailStateMachine-CSyUXPrM.esm.js → emailStateMachine-Bcv-dM_k.esm.js} +4 -4
- package/dist/{events-CLo0CBD5.esm.js → events-D6rNtFDO.esm.js} +4 -2
- package/dist/events.d.ts +1 -0
- package/dist/events.esm.js +2 -2
- package/dist/extensibility.d.ts +15 -15
- package/dist/extensibility.esm.js +33 -33
- package/dist/face-match.d.ts +1 -1
- package/dist/face-match.esm.js +4 -4
- package/dist/{faceCaptureManagerFactory-XQOqroTM.d.ts → faceCaptureManagerFactory-CsF2i81A.d.ts} +8 -8
- package/dist/{faceCaptureManagerFactory-B9xq08-G.esm.js → faceCaptureManagerFactory-D1R5A-s3.esm.js} +2 -2
- package/dist/{faceCaptureSetup-QU9jwWFa.esm.js → faceCaptureSetup-FUncr8AV.esm.js} +4 -4
- package/dist/{faceMatchStateMachine-B03-JK_T.esm.js → faceMatchStateMachine-Bm0RrtNZ.esm.js} +3 -3
- package/dist/flow.d.ts +8 -8
- package/dist/flow.esm.js +9 -9
- package/dist/{flowCompletionService-DDrZ_9FJ.esm.js → flowCompletionService-DNwDhild.esm.js} +2 -2
- package/dist/{flowServices-UvwXCNq9.esm.js → flowServices-COjf6aN_.esm.js} +3 -3
- package/dist/geolocation.d.ts +2 -2
- package/dist/geolocation.esm.js +5 -5
- package/dist/{geolocationStateMachine-Co0puEUX.esm.js → geolocationStateMachine-nhuJw6Da.esm.js} +4 -4
- package/dist/{getDeviceClass-BiqKa0Vc.esm.js → getDeviceClass-ByKIa-2E.esm.js} +1 -1
- package/dist/government-validation.d.ts +2 -2
- package/dist/government-validation.esm.js +5 -5
- package/dist/{governmentValidationStateMachine-CtccpJa8.esm.js → governmentValidationStateMachine-Ksonp_gh.esm.js} +4 -4
- package/dist/home.d.ts +14 -14
- package/dist/home.esm.js +3 -3
- package/dist/http.esm.js +1 -1
- package/dist/id.d.ts +10 -10
- package/dist/id.esm.js +22 -22
- package/dist/{idCaptureManager-DaqJk3sg.d.ts → idCaptureManager-BK9249dL.d.ts} +7 -7
- package/dist/{idCaptureManager-DB8tfDFF.esm.js → idCaptureManager-C5RQfRPT.esm.js} +4 -4
- package/dist/{idCaptureStateMachine-BBf5lODM.esm.js → idCaptureStateMachine-WmW7bDGZ.esm.js} +16 -16
- package/dist/identity-reuse.d.ts +46 -46
- package/dist/identity-reuse.esm.js +3 -3
- package/dist/{index-Cj-bgOly.d.ts → index-SUQ4OOw8.d.ts} +120 -120
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +8 -8
- package/dist/{lib-Cr7zqmnX.esm.js → lib-T6LfeDCk.esm.js} +1 -1
- package/dist/mandatory-consent.d.ts +55 -55
- package/dist/mandatory-consent.esm.js +4 -4
- package/dist/{mandatoryConsentStateMachine-DNVESbJF.esm.js → mandatoryConsentStateMachine-D_ljDR9e.esm.js} +3 -3
- package/dist/openviduLazy-B_nGnLzX.esm.js +3 -0
- package/dist/{openviduLazy-DR5nnQZW.esm.js → openviduLazy-D06MyxiN.esm.js} +2 -2
- package/dist/{permissionServices-Dso6GWap.esm.js → permissionServices-Y2PDGdE5.esm.js} +2 -2
- package/dist/phone.d.ts +3 -3
- package/dist/phone.esm.js +6 -6
- package/dist/{phoneManager-CZkwAnZA.d.ts → phoneManager-B5_bo3cx.d.ts} +2 -2
- package/dist/{phoneManager-BFinSDdo.esm.js → phoneManager-B9NF66Bk.esm.js} +3 -3
- package/dist/{phoneStateMachine-BjhtmUGF.esm.js → phoneStateMachine-DHaPFdWu.esm.js} +4 -4
- package/dist/{qe-signature-LHWeEEln.esm.js → qe-signature-BGmul0lF.esm.js} +1 -1
- package/dist/qe-signature.d.ts +3 -3
- package/dist/qe-signature.esm.js +5 -5
- package/dist/{recordingService-C4pR3IWN.esm.js → recordingService-0YxgQN6u.esm.js} +13 -13
- package/dist/redirect-to-mobile.d.ts +2 -2
- package/dist/redirect-to-mobile.esm.js +5 -5
- package/dist/{redirectToMobileStateMachine-Clr48nAr.esm.js → redirectToMobileStateMachine-CsfV3Enr.esm.js} +4 -4
- package/dist/{runChildModule-CPESMGyI.esm.js → runChildModule-QrTGfn6L.esm.js} +1 -1
- package/dist/selfie.d.ts +11 -11
- package/dist/selfie.esm.js +22 -22
- package/dist/{selfieManager-Bsag2fr3.d.ts → selfieManager-BXCyE1Rs.d.ts} +2 -2
- package/dist/{selfieManager-BzQvkdCk.esm.js → selfieManager-D57rdQLg.esm.js} +6 -6
- package/dist/{selfieStateMachine-CYcGwdw6.esm.js → selfieStateMachine-Bd7WGYZs.esm.js} +3 -3
- package/dist/{session-Ccqv3mbs.esm.js → session-D3XXfTZP.esm.js} +4 -4
- package/dist/session.d.ts +1 -1
- package/dist/session.esm.js +6 -6
- package/dist/{setup-BNco1B1s.esm.js → setup-CEbsLRbC.esm.js} +5 -5
- package/dist/{setup-B1NHjpFM.d.ts → setup-CvNq0dnW.d.ts} +1 -1
- package/dist/signature.d.ts +2 -2
- package/dist/signature.esm.js +4 -4
- package/dist/{signatureStateMachine-CJC7eNaf.esm.js → signatureStateMachine-C-MP8GI1.esm.js} +3 -3
- package/dist/{stats-DdObETry.esm.js → stats-DVL1TL6Q.esm.js} +1 -1
- package/dist/stats.esm.js +2 -2
- package/dist/{types-DGwsRYfm.d.ts → types-BWYMM3Em.d.ts} +1 -1
- package/dist/{types-DH_kbvQH.d.ts → types-B_UqiV6s.d.ts} +1 -1
- package/dist/{types-x6tue2ld.d.ts → types-CfsXFnOc.d.ts} +2 -2
- package/dist/wasm.d.ts +2 -2
- package/dist/wasm.esm.js +8 -8
- package/dist/watchlist.d.ts +1 -1
- package/dist/watchlist.esm.js +3 -3
- package/dist/workflow.d.ts +89 -89
- package/dist/workflow.esm.js +44 -44
- package/package.json +7 -3
- package/dist/openviduLazy-BpeU96mV.esm.js +0 -3
- /package/dist/{Actor-Cqaw-2DF.d.ts → Actor-BS3rbtoo.d.ts} +0 -0
- /package/dist/{BaseWasmProvider-D2uvIbAN.esm.js → BaseWasmProvider-Dr9Bb1Zg.esm.js} +0 -0
- /package/dist/{BrowserEnvironmentProvider-D7IR7V-D.esm.js → BrowserEnvironmentProvider-CfUNEigg.esm.js} +0 -0
- /package/dist/{BrowserStorageProvider-DOp7HlOV.esm.js → BrowserStorageProvider-Bww9xk7g.esm.js} +0 -0
- /package/dist/{BrowserTimerProvider-DDCqhG2g.esm.js → BrowserTimerProvider-D4hR9uTM.esm.js} +0 -0
- /package/dist/{ITimerCapability-6rqYcRcc.esm.js → ITimerCapability-C-3gFxPH.esm.js} +0 -0
- /package/dist/{Manager-C1r-74H0.d.ts → Manager-B8qNVwIm.d.ts} +0 -0
- /package/dist/{MotionSensorProvider-CH2gIQDD.esm.js → MotionSensorProvider-2eRGynHs.esm.js} +0 -0
- /package/dist/{StateMachine-sxIjYRWS.d.ts → StateMachine-CudHTJ_-.d.ts} +0 -0
- /package/dist/{api-BhYI_G8R.esm.js → api-Bq5aVL0-.esm.js} +0 -0
- /package/dist/{browserSimulation-UTYyQOiB.esm.js → browserSimulation-D5C2Zw4l.esm.js} +0 -0
- /package/dist/{camera-KXMnriZv.esm.js → camera-BToe85ME.esm.js} +0 -0
- /package/dist/{camera-C1Lz6NFz.d.ts → camera-ZjE1I_AX.d.ts} +0 -0
- /package/dist/{chunk-QwZHFM5S.esm.js → chunk-DFZh8Bbf.esm.js} +0 -0
- /package/dist/{displayErrors-BDMmeDc6.d.ts → displayErrors-B81yh8Sq.d.ts} +0 -0
- /package/dist/{flowCompletionService-D1DGDmXn.d.ts → flowCompletionService-CNIs-z4L.d.ts} +0 -0
- /package/dist/{getBrowser-4G-fNoOH.esm.js → getBrowser-BnEXznKu.esm.js} +0 -0
- /package/dist/{platform-BcNZipjK.esm.js → platform-CwFB3DeY.esm.js} +0 -0
- /package/dist/{types-B-JXmW0H.d.ts → types-Cd9eT9p-.d.ts} +0 -0
- /package/dist/{warmup-BoNCXpou.d.ts → warmup-DE8UbO36.d.ts} +0 -0
- /package/dist/{xstate.esm-BlgyVBVv.esm.js → xstate.esm-BR-OL9fa.esm.js} +0 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { t as Manager } from "./Manager-B8qNVwIm.js";
|
|
2
|
+
import "./Actor-BS3rbtoo.js";
|
|
3
|
+
|
|
4
|
+
//#region src/modules/custom-fields/types.d.ts
|
|
5
|
+
type CustomFieldType = 'INTEGER' | 'DOUBLE' | 'BOOLEAN' | 'STRING' | 'DATE';
|
|
6
|
+
type CustomField = {
|
|
7
|
+
name: string;
|
|
8
|
+
alias: string;
|
|
9
|
+
type: CustomFieldType;
|
|
10
|
+
};
|
|
11
|
+
type CustomFieldsConfig = {
|
|
12
|
+
title: string;
|
|
13
|
+
customFields: CustomField[];
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/modules/custom-fields/customFieldsStateMachine.d.ts
|
|
17
|
+
type CustomFieldsResult = 'success' | 'failed';
|
|
18
|
+
declare const customFieldsMachine: any;
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/modules/custom-fields/customFieldsActor.d.ts
|
|
21
|
+
type CreateCustomFieldsActorOptions = {
|
|
22
|
+
config: CustomFieldsConfig;
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/modules/custom-fields/customFieldsManager.d.ts
|
|
26
|
+
/**
|
|
27
|
+
* A `CustomField` enriched with a computed `label` for display.
|
|
28
|
+
* Label is derived from `alias` when present, otherwise auto-formatted from `name`.
|
|
29
|
+
*/
|
|
30
|
+
type MappedCustomField = CustomField & {
|
|
31
|
+
label: string;
|
|
32
|
+
};
|
|
33
|
+
/** Custom fields manager is in initial state, waiting for `load()` to be called */
|
|
34
|
+
type CustomFieldsIdleState = {
|
|
35
|
+
status: 'idle';
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Ready for field input — use `setField()` and `submit()`
|
|
39
|
+
* @property title - Form title from configuration
|
|
40
|
+
* @property customFields - Field definitions with computed display labels
|
|
41
|
+
* @property canSubmit - True when all non-boolean fields have a non-empty value
|
|
42
|
+
*/
|
|
43
|
+
type CustomFieldsInputtingState = {
|
|
44
|
+
status: 'inputting';
|
|
45
|
+
title: string;
|
|
46
|
+
customFields: MappedCustomField[];
|
|
47
|
+
canSubmit: boolean;
|
|
48
|
+
};
|
|
49
|
+
/** Fields are being submitted to the backend */
|
|
50
|
+
type CustomFieldsSubmittingState = {
|
|
51
|
+
status: 'submitting';
|
|
52
|
+
title: string;
|
|
53
|
+
};
|
|
54
|
+
/** API call succeeded — success page is visible for ~3 s before finishing */
|
|
55
|
+
type CustomFieldsSuccessState = {
|
|
56
|
+
status: 'success';
|
|
57
|
+
};
|
|
58
|
+
/** Custom fields flow complete. `result` indicates whether the API call succeeded or failed. */
|
|
59
|
+
type CustomFieldsFinishedState = {
|
|
60
|
+
status: 'finished';
|
|
61
|
+
result: CustomFieldsResult | null;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Union of all possible custom fields manager states.
|
|
65
|
+
*/
|
|
66
|
+
type CustomFieldsState = CustomFieldsIdleState | CustomFieldsInputtingState | CustomFieldsSubmittingState | CustomFieldsSuccessState | CustomFieldsFinishedState;
|
|
67
|
+
/**
|
|
68
|
+
* Creates a custom fields manager for headless or UI-driven usage.
|
|
69
|
+
*
|
|
70
|
+
* @param options - Configuration options
|
|
71
|
+
* @param options.config - Custom fields configuration (title + field definitions)
|
|
72
|
+
*
|
|
73
|
+
* @returns Custom fields manager with state, API methods, and subscription
|
|
74
|
+
*
|
|
75
|
+
* @example Headless usage
|
|
76
|
+
* ```typescript
|
|
77
|
+
* const manager = createCustomFieldsManager({
|
|
78
|
+
* config: {
|
|
79
|
+
* title: 'Additional Information',
|
|
80
|
+
* customFields: [{ name: 'company', alias: 'Company', type: 'STRING' }],
|
|
81
|
+
* },
|
|
82
|
+
* });
|
|
83
|
+
*
|
|
84
|
+
* manager.subscribe((state) => console.log(state.status));
|
|
85
|
+
* manager.load();
|
|
86
|
+
* manager.setField('company', 'Incode');
|
|
87
|
+
* manager.submit();
|
|
88
|
+
* manager.stop();
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
declare function createCustomFieldsManager(options: CreateCustomFieldsActorOptions): Manager<CustomFieldsState> & {
|
|
92
|
+
/**
|
|
93
|
+
* Initializes the custom fields flow.
|
|
94
|
+
* Transitions from 'idle' to 'inputting'.
|
|
95
|
+
* Must be called before any other method.
|
|
96
|
+
*/
|
|
97
|
+
load(): void;
|
|
98
|
+
/**
|
|
99
|
+
* Updates the value of a single field.
|
|
100
|
+
* Should be called when state is 'inputting'.
|
|
101
|
+
*
|
|
102
|
+
* @param name - The field name (matches CustomField.name)
|
|
103
|
+
* @param value - The field value (string, number, or boolean)
|
|
104
|
+
*/
|
|
105
|
+
setField(name: string, value: string | number | boolean): void;
|
|
106
|
+
/**
|
|
107
|
+
* Submits all custom field values to the backend.
|
|
108
|
+
* Transitions to 'submitting', then 'finished' regardless of outcome.
|
|
109
|
+
*/
|
|
110
|
+
submit(): void;
|
|
111
|
+
};
|
|
112
|
+
/** Type representing a custom fields manager instance. */
|
|
113
|
+
type CustomFieldsManager = ReturnType<typeof createCustomFieldsManager>;
|
|
114
|
+
//#endregion
|
|
115
|
+
export { type CustomField, type CustomFieldType, type CustomFieldsConfig, type CustomFieldsManager, type CustomFieldsState, type MappedCustomField, createCustomFieldsManager, customFieldsMachine };
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { t as api } from "./api-Bq5aVL0-.esm.js";
|
|
2
|
+
import { _ as endpoints, n as eventModuleNames, o as createManagerInstrumentation } from "./events-D6rNtFDO.esm.js";
|
|
3
|
+
import { a as createActor, i as fromPromise, n as assign, o as createManager, t as setup } from "./xstate.esm-BR-OL9fa.esm.js";
|
|
4
|
+
|
|
5
|
+
//#region src/shared/dateUtils.ts
|
|
6
|
+
/**
|
|
7
|
+
* Converts an ISO date string (YYYY-MM-DD) to Unix milliseconds.
|
|
8
|
+
*
|
|
9
|
+
* Uses Julian Day Number arithmetic so no platform Date API is needed,
|
|
10
|
+
* keeping this utility usable in any environment (browser, Node, workers).
|
|
11
|
+
*
|
|
12
|
+
* @param dateStr - A date string in YYYY-MM-DD format (as produced by HTML date inputs)
|
|
13
|
+
* @returns Milliseconds since the Unix epoch (UTC midnight of the given date)
|
|
14
|
+
*/
|
|
15
|
+
function isoDateToMs(dateStr) {
|
|
16
|
+
const [yearStr = "1970", monthStr = "01", dayStr = "01"] = dateStr.split("-");
|
|
17
|
+
const y = +yearStr;
|
|
18
|
+
const m = +monthStr;
|
|
19
|
+
const d = +dayStr;
|
|
20
|
+
const a = Math.floor((14 - m) / 12);
|
|
21
|
+
const ya = y + 4800 - a;
|
|
22
|
+
const ma = m + 12 * a - 3;
|
|
23
|
+
return (d + Math.floor((153 * ma + 2) / 5) + 365 * ya + Math.floor(ya / 4) - Math.floor(ya / 100) + Math.floor(ya / 400) - 32045 - 2440588) * 864e5;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/modules/custom-fields/customFieldsServices.ts
|
|
28
|
+
async function submitCustomFields(params, signal) {
|
|
29
|
+
const res = await api.post(endpoints.addCustomFields, params.fields, { signal });
|
|
30
|
+
if (!res.ok) throw new Error(`POST ${endpoints.addCustomFields} failed: ${res.status} ${res.statusText}`);
|
|
31
|
+
return res.data;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/modules/custom-fields/customFieldsStateMachine.ts
|
|
36
|
+
function transformFields(fields, customFields) {
|
|
37
|
+
const result = {};
|
|
38
|
+
for (const [key, value] of Object.entries(fields)) if (customFields.find((f) => f.name === key)?.type === "DATE" && typeof value === "string" && value !== "") result[key] = isoDateToMs(value);
|
|
39
|
+
else result[key] = value;
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
const customFieldsMachine = setup({
|
|
43
|
+
types: {
|
|
44
|
+
context: {},
|
|
45
|
+
events: {},
|
|
46
|
+
input: {}
|
|
47
|
+
},
|
|
48
|
+
actors: { submitFields: fromPromise(async ({ input, signal }) => {
|
|
49
|
+
return submitCustomFields({ fields: transformFields(input.fields, input.customFields) }, signal);
|
|
50
|
+
}) },
|
|
51
|
+
actions: {
|
|
52
|
+
setField: assign(({ context, event }) => {
|
|
53
|
+
const e = event;
|
|
54
|
+
return { fields: {
|
|
55
|
+
...context.fields,
|
|
56
|
+
[e.name]: e.value
|
|
57
|
+
} };
|
|
58
|
+
}),
|
|
59
|
+
markSuccess: assign({ result: "success" }),
|
|
60
|
+
markFailed: assign({ result: "failed" })
|
|
61
|
+
},
|
|
62
|
+
guards: { apiSucceeded: ({ event }) => event.output.success }
|
|
63
|
+
}).createMachine({
|
|
64
|
+
id: "customFields",
|
|
65
|
+
initial: "idle",
|
|
66
|
+
context: ({ input }) => ({
|
|
67
|
+
config: input.config,
|
|
68
|
+
fields: {},
|
|
69
|
+
result: null
|
|
70
|
+
}),
|
|
71
|
+
states: {
|
|
72
|
+
idle: { on: { LOAD: { target: "inputting" } } },
|
|
73
|
+
inputting: { on: {
|
|
74
|
+
FIELD_CHANGED: { actions: "setField" },
|
|
75
|
+
SUBMIT: { target: "submitting" }
|
|
76
|
+
} },
|
|
77
|
+
submitting: { invoke: {
|
|
78
|
+
id: "submitFields",
|
|
79
|
+
src: "submitFields",
|
|
80
|
+
input: ({ context }) => ({
|
|
81
|
+
fields: context.fields,
|
|
82
|
+
customFields: context.config.customFields
|
|
83
|
+
}),
|
|
84
|
+
onDone: [{
|
|
85
|
+
target: "success",
|
|
86
|
+
guard: "apiSucceeded"
|
|
87
|
+
}, {
|
|
88
|
+
target: "finished",
|
|
89
|
+
actions: "markFailed"
|
|
90
|
+
}],
|
|
91
|
+
onError: {
|
|
92
|
+
target: "finished",
|
|
93
|
+
actions: "markFailed"
|
|
94
|
+
}
|
|
95
|
+
} },
|
|
96
|
+
success: { after: { 3e3: {
|
|
97
|
+
target: "finished",
|
|
98
|
+
actions: "markSuccess"
|
|
99
|
+
} } },
|
|
100
|
+
finished: { type: "final" }
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region src/modules/custom-fields/customFieldsActor.ts
|
|
106
|
+
function createCustomFieldsActor(options) {
|
|
107
|
+
return createActor(customFieldsMachine, { input: { config: options.config } }).start();
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region src/modules/custom-fields/customFieldsManager.ts
|
|
112
|
+
function toDisplayLabel(field) {
|
|
113
|
+
if (field.alias) return field.alias;
|
|
114
|
+
return field.name.replace(/([A-Z])/g, " $1").replace(/^./, (s) => s.toUpperCase());
|
|
115
|
+
}
|
|
116
|
+
function isFormComplete(fields, customFields) {
|
|
117
|
+
return customFields.every((f) => {
|
|
118
|
+
if (f.type === "BOOLEAN") return true;
|
|
119
|
+
const value = fields[f.name];
|
|
120
|
+
return value !== void 0 && value !== "";
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function mapState(snapshot) {
|
|
124
|
+
const typedSnapshot = snapshot;
|
|
125
|
+
const { context } = typedSnapshot;
|
|
126
|
+
if (typedSnapshot.matches("idle")) return { status: "idle" };
|
|
127
|
+
if (typedSnapshot.matches("inputting")) return {
|
|
128
|
+
status: "inputting",
|
|
129
|
+
title: context.config.title,
|
|
130
|
+
customFields: context.config.customFields.map((f) => ({
|
|
131
|
+
...f,
|
|
132
|
+
label: toDisplayLabel(f)
|
|
133
|
+
})),
|
|
134
|
+
canSubmit: isFormComplete(context.fields, context.config.customFields)
|
|
135
|
+
};
|
|
136
|
+
if (typedSnapshot.matches("submitting")) return {
|
|
137
|
+
status: "submitting",
|
|
138
|
+
title: context.config.title
|
|
139
|
+
};
|
|
140
|
+
if (typedSnapshot.matches("success")) return { status: "success" };
|
|
141
|
+
return {
|
|
142
|
+
status: "finished",
|
|
143
|
+
result: typedSnapshot.context.result
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function createApi({ actor }) {
|
|
147
|
+
return {
|
|
148
|
+
load() {
|
|
149
|
+
actor.send({ type: "LOAD" });
|
|
150
|
+
},
|
|
151
|
+
setField(name, value) {
|
|
152
|
+
actor.send({
|
|
153
|
+
type: "FIELD_CHANGED",
|
|
154
|
+
name,
|
|
155
|
+
value
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
submit() {
|
|
159
|
+
actor.send({ type: "SUBMIT" });
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Creates a custom fields manager for headless or UI-driven usage.
|
|
165
|
+
*
|
|
166
|
+
* @param options - Configuration options
|
|
167
|
+
* @param options.config - Custom fields configuration (title + field definitions)
|
|
168
|
+
*
|
|
169
|
+
* @returns Custom fields manager with state, API methods, and subscription
|
|
170
|
+
*
|
|
171
|
+
* @example Headless usage
|
|
172
|
+
* ```typescript
|
|
173
|
+
* const manager = createCustomFieldsManager({
|
|
174
|
+
* config: {
|
|
175
|
+
* title: 'Additional Information',
|
|
176
|
+
* customFields: [{ name: 'company', alias: 'Company', type: 'STRING' }],
|
|
177
|
+
* },
|
|
178
|
+
* });
|
|
179
|
+
*
|
|
180
|
+
* manager.subscribe((state) => console.log(state.status));
|
|
181
|
+
* manager.load();
|
|
182
|
+
* manager.setField('company', 'Incode');
|
|
183
|
+
* manager.submit();
|
|
184
|
+
* manager.stop();
|
|
185
|
+
* ```
|
|
186
|
+
*/
|
|
187
|
+
function createCustomFieldsManager(options) {
|
|
188
|
+
return createManager({
|
|
189
|
+
actor: createCustomFieldsActor(options),
|
|
190
|
+
mapState,
|
|
191
|
+
createApi,
|
|
192
|
+
instrumentation: createManagerInstrumentation(eventModuleNames.customFields)
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
//#endregion
|
|
197
|
+
export { createCustomFieldsManager, customFieldsMachine };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "./BaseWasmProvider-
|
|
2
|
-
import { t as WasmUtilProvider } from "./WasmUtilProvider-
|
|
3
|
-
import "./api-
|
|
4
|
-
import { t as BrowserEnvironmentProvider } from "./BrowserEnvironmentProvider-
|
|
5
|
-
import "./browserSimulation-
|
|
6
|
-
import { t as createDeepsightService } from "./deepsightService-
|
|
7
|
-
import "./camera-
|
|
8
|
-
import "./getBrowser-
|
|
9
|
-
import "./stats-
|
|
10
|
-
import { t as MotionSensorProvider } from "./MotionSensorProvider-
|
|
1
|
+
import "./BaseWasmProvider-Dr9Bb1Zg.esm.js";
|
|
2
|
+
import { t as WasmUtilProvider } from "./WasmUtilProvider-DLgdRyEg.esm.js";
|
|
3
|
+
import "./api-Bq5aVL0-.esm.js";
|
|
4
|
+
import { t as BrowserEnvironmentProvider } from "./BrowserEnvironmentProvider-CfUNEigg.esm.js";
|
|
5
|
+
import "./browserSimulation-D5C2Zw4l.esm.js";
|
|
6
|
+
import { t as createDeepsightService } from "./deepsightService-Df3Ad9a2.esm.js";
|
|
7
|
+
import "./camera-BToe85ME.esm.js";
|
|
8
|
+
import "./getBrowser-BnEXznKu.esm.js";
|
|
9
|
+
import "./stats-DVL1TL6Q.esm.js";
|
|
10
|
+
import { t as MotionSensorProvider } from "./MotionSensorProvider-2eRGynHs.esm.js";
|
|
11
11
|
|
|
12
12
|
//#region ../infra/src/providers/browser/VisibilityProvider.ts
|
|
13
13
|
var VisibilityProvider = class {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as WasmPipeline } from "./warmup-
|
|
2
|
-
import { t as CameraStream } from "./camera-
|
|
1
|
+
import { n as WasmPipeline } from "./warmup-DE8UbO36.js";
|
|
2
|
+
import { t as CameraStream } from "./camera-ZjE1I_AX.js";
|
|
3
3
|
|
|
4
4
|
//#region ../infra/src/capabilities/IRecordingCapability.d.ts
|
|
5
5
|
type RecordingPublisher = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as api } from "./api-
|
|
2
|
-
import { t as isBrowserSimulation } from "./browserSimulation-
|
|
3
|
-
import { i as stopCameraStream, r as requestCameraAccess } from "./camera-
|
|
4
|
-
import { n as getDeviceInfo, t as getUserAgent } from "./getBrowser-
|
|
5
|
-
import { t as addDeviceStats } from "./stats-
|
|
1
|
+
import { t as api } from "./api-Bq5aVL0-.esm.js";
|
|
2
|
+
import { t as isBrowserSimulation } from "./browserSimulation-D5C2Zw4l.esm.js";
|
|
3
|
+
import { i as stopCameraStream, r as requestCameraAccess } from "./camera-BToe85ME.esm.js";
|
|
4
|
+
import { n as getDeviceInfo, t as getUserAgent } from "./getBrowser-BnEXznKu.esm.js";
|
|
5
|
+
import { t as addDeviceStats } from "./stats-DVL1TL6Q.esm.js";
|
|
6
6
|
|
|
7
7
|
//#region ../infra/src/media/canvas.ts
|
|
8
8
|
/**
|
package/dist/device.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as getUserAgent } from "./getBrowser-
|
|
2
|
-
import { i as isIPad } from "./platform-
|
|
3
|
-
import { t as getDeviceClass } from "./getDeviceClass-
|
|
1
|
+
import { t as getUserAgent } from "./getBrowser-BnEXznKu.esm.js";
|
|
2
|
+
import { i as isIPad } from "./platform-CwFB3DeY.esm.js";
|
|
3
|
+
import { t as getDeviceClass } from "./getDeviceClass-ByKIa-2E.esm.js";
|
|
4
4
|
|
|
5
5
|
//#region src/internal/device/getBrowser.ts
|
|
6
6
|
function getBrowser() {
|