@incodetech/web 0.0.0-dev-20260608-c8c427ca → 0.0.0-dev-20260609-11ba3e8a
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/ae-signature/ae-signature.es.js +15 -13
- package/dist/aligndevicelottie-DY_bX_p8.js +12769 -0
- package/dist/antifraud/antifraud.es.js +22 -19
- package/dist/authentication/authentication.es.js +42 -33
- package/dist/autoFocusTitle-DM6PvgcP.js +29 -0
- package/dist/{back-horizontal-hint-DsPhKbR4.js → back-horizontal-hint-BXYix0Wj.js} +26 -26
- package/dist/back-tutorial-vb1MxlrT.js +14597 -0
- package/dist/{back-vertical-hint-BFJbYQrX.js → back-vertical-hint-DNSh6JNH.js} +27 -27
- package/dist/backdevicelottie-HypPqBz7.js +16690 -0
- package/dist/base.css +5 -0
- package/dist/blurdevicelottie-CBXtBFiJ.js +15951 -0
- package/dist/bottomSheet-BuzqNQtG.js +39 -0
- package/dist/browser-ponyfill-CLLvZCVg.js +441 -0
- package/dist/button-B-qlr4iI.js +35 -0
- package/dist/checkbox-CTPETqo5.js +96 -0
- package/dist/consent/consent.es.js +75 -64
- package/dist/countrySelector-CzyuaDIs.js +60 -0
- package/dist/cpf-ocr/cpf-ocr.es.js +2 -2
- package/dist/cpfOcr-DQVs3r8N.js +92 -0
- package/dist/cpfOcr-WNklFuxT.js +2 -0
- package/dist/cross-document-data-match/cross-document-data-match.es.js +20 -17
- package/dist/curp-validation/curp-validation.es.js +246 -211
- package/dist/customFields-B4MqqDI6.js +140 -0
- package/dist/customWatchlist-Dfqw1DQP.js +36 -0
- package/dist/dateInputComposed-BsPQHG5o.js +1 -0
- package/dist/dateInputComposed-DY97tQVK.js +69 -0
- package/dist/defineProperty-mefzVtTv.js +39 -0
- package/dist/document-capture/document-capture.es.js +2 -2
- package/dist/documentCapture-BE78MIlR.js +876 -0
- package/dist/documentCapture-BVfNZL29.js +2 -0
- package/dist/dropdownComposed-BF4L-7mJ.js +380 -0
- package/dist/dropdownComposed-mvHuRFHn.js +1 -0
- package/dist/dynamicForms-BYGGAQoc.js +352 -0
- package/dist/ekyb/ekyb.es.js +2 -2
- package/dist/ekybModule-BUPX0QhW.js +2 -0
- package/dist/ekybModule-CkTXu-4u.js +279 -0
- package/dist/ekyc/ekyc.es.js +2 -2
- package/dist/ekycModule-BWsVX39d.js +257 -0
- package/dist/ekycModule-DNDPqvUc.js +2 -0
- package/dist/electronic-signature/electronic-signature.es.js +2 -2
- package/dist/electronic-signature-BJSyzex9.js +426 -0
- package/dist/email/email.es.js +198 -78
- package/dist/emailInput-BHp4Apt4.js +39 -0
- package/dist/errorIcon-B0rmz3rw.js +26 -0
- package/dist/expiredId-C105HVKv.js +85 -0
- package/dist/extensibility-DJwVxojG.js +3070 -0
- package/dist/extensibility.es.js +26 -26
- package/dist/face-match/face-match.es.js +2 -2
- package/dist/faceMatch-BOFGxzzx.js +343 -0
- package/dist/faceMatch-CDMcFQwR.js +2 -0
- package/dist/field-comparison/field-comparison.es.js +2 -2
- package/dist/fieldComparison-BMDmQ8eA.js +88 -0
- package/dist/fieldComparison-Z1NleSxD.js +2 -0
- package/dist/{flip-animation-CuQ57qTn.js → flip-animation-BGRvygw9.js} +4221 -4221
- package/dist/flow/flow.es.js +597 -493
- package/dist/flow/styles.css +0 -8
- package/dist/{front-horizontal-hint-CKm7PnmS.js → front-horizontal-hint-CLSU0iVo.js} +70 -70
- package/dist/{front-vertical-hint-CLHC2qoH.js → front-vertical-hint-BWq-yWQ8.js} +81 -81
- package/dist/frontdevicelottie-CLqitJhG.js +17314 -0
- package/dist/geolocation/geolocation.es.js +485 -395
- package/dist/glaredevicelottie-BS04U6Fc.js +14478 -0
- package/dist/governmentValidation/governmentValidation.es.js +145 -64
- package/dist/governmentValidation/styles.css +0 -36
- package/dist/homeScreen-BsEYyiDB.js +264 -0
- package/dist/hooks-BtgmGvba.js +149 -0
- package/dist/i18n-gTHArCl9.js +2971 -0
- package/dist/icons-DKY3xDkf.js +360 -0
- package/dist/id/id.es.js +565 -413
- package/dist/id-laser-h-DX8UbVNH.js +467 -0
- package/dist/id-laser-v-DhnHdjlB.js +490 -0
- package/dist/id-tutorial-lj4iKtYT.js +13165 -0
- package/dist/id-verification/id-verification.es.js +21 -18
- package/dist/idOcr-BS77o1VC.js +123 -0
- package/dist/identity-reuse/identity-reuse.es.js +168 -130
- package/dist/incode-logo-57XFniXU.js +4 -0
- package/dist/incodeComponent-CDJxFZvS.js +63 -0
- package/dist/incodeModule-DkA_yd0X.js +13 -0
- package/dist/index.es.js +16 -14
- package/dist/inputComposed-5V2nLTqH.js +99 -0
- package/dist/inputComposed-BPOYwUBl.js +1 -0
- package/dist/loadingIcon-DN62ugKs.js +148 -0
- package/dist/lottie_light-Dp9Bz3mf.js +9031 -0
- package/dist/mandatoryConsent-DP189TUn.js +107 -0
- package/dist/modal-B5QeulDu.js +153 -0
- package/dist/modal.hooks-C7K9k_pY.js +202 -0
- package/dist/numberedStep-DVAyTPv1.js +13 -0
- package/dist/optionAccessibleLabel-Czc2YC8z.js +202 -0
- package/dist/otpInput-2IQ-JCK8.js +195 -0
- package/dist/page-BZ-0eNWq.js +71 -0
- package/dist/{passport-horizontal-hint-C_le0HVU.js → passport-horizontal-hint-DfVsf4Cc.js} +55 -55
- package/dist/{passport-tutorial-BYN4T_TE.js → passport-tutorial-zT1ZoA-D.js} +7096 -7084
- package/dist/{passport-vertical-hint-H-pyICSv.js → passport-vertical-hint-DVxbTyQp.js} +49 -49
- package/dist/pdf-BZA70WbM.js +22398 -0
- package/dist/pdfViewer-Dr63sJ51.js +114 -0
- package/dist/phone/phone.es.js +214 -87
- package/dist/phoneInputComposed-D_IabWKJ.js +12142 -0
- package/dist/processing-B_u8wUB7.js +8 -0
- package/dist/qe-signature/qe-signature.es.js +15 -13
- package/dist/radioGroupComposed-DwYW-Ld-.js +215 -0
- package/dist/redirect-to-mobile/redirect-to-mobile.es.js +2099 -859
- package/dist/registerIncodeElement-BJJGzVdq.js +11 -0
- package/dist/requiredLabelHint-DEadtiwx.js +17 -0
- package/dist/richText-C7GUm0WL.js +3153 -0
- package/dist/rolldown-runtime--E5BIlTp.js +33 -0
- package/dist/selfie/selfie.es.js +54 -42
- package/dist/selfieTutorial-CtruLyO2.js +2689 -0
- package/dist/signature/signature.es.js +765 -406
- package/dist/snackbar-Dz9crm39.js +16 -0
- package/dist/spinner-BfBIZkDQ.js +42 -0
- package/dist/spinner-DEDtE7Pz.js +1 -0
- package/dist/statusPage-CVCoieyd.js +28 -0
- package/dist/successIcon-rmzr-pxu.js +30 -0
- package/dist/tabs--UMd6eEB.js +103 -0
- package/dist/transitionSpinner-CWhGcr7c.js +26 -0
- package/dist/{tutorial-QzQ536BL.js → tutorial-Jv0noW4z.js} +832 -578
- package/dist/types/extensibility.d.ts +3 -1
- package/dist/types/index.d.ts +13 -4
- package/dist/typography-BK4AmfKX.js +45 -0
- package/dist/uiConfig-sgEkFuuA.js +25 -0
- package/dist/useModuleLoader-CuhHtmgr.js +670 -0
- package/dist/vendor-preact-BH7vOa2r.js +957 -0
- package/dist/verificationResult-CJ0JyV6A.js +64 -0
- package/dist/verifiedByIncode-8QBn-kgZ.js +103 -0
- package/dist/watchlist/watchlist.es.js +31 -26
- package/dist/watchlistForBusiness-RZcnjVDb.js +80 -0
- package/dist/workflow/styles.css +0 -8
- package/dist/workflow/workflow.es.js +251 -209
- package/package.json +4 -2
- package/dist/aligndevicelottie-D8KsO77t.js +0 -12757
- package/dist/autoFocusTitle-BpYdaSUM.js +0 -16
- package/dist/back-tutorial-DhSE2FJo.js +0 -14585
- package/dist/backdevicelottie-CJWGVMdw.js +0 -16678
- package/dist/blurdevicelottie-Dxt2deEB.js +0 -15939
- package/dist/bottomSheet-QrpyatOD.js +0 -31
- package/dist/browser-ponyfill-Crda_c5R.js +0 -299
- package/dist/button-DcCUEn2n.js +0 -24
- package/dist/checkbox-DCCzBAuF.js +0 -86
- package/dist/countrySelector-CJ8egQ4C.js +0 -58
- package/dist/cpfOcr-Db06i-Lm.js +0 -2
- package/dist/cpfOcr-FixhUeMQ.js +0 -79
- package/dist/customFields-C1G9xHNX.js +0 -125
- package/dist/customWatchlist-IKEblz7u.js +0 -31
- package/dist/dateInputComposed-Cg8BvYSK.js +0 -1
- package/dist/dateInputComposed-Ddd7HLyM.js +0 -58
- package/dist/defineProperty-xczUyn-m.js +0 -39
- package/dist/documentCapture-D9I7FjGe.js +0 -2
- package/dist/documentCapture-b61wlala.js +0 -765
- package/dist/dropdownComposed-B4U0AIak.js +0 -1
- package/dist/dropdownComposed-CS2pyn-g.js +0 -293
- package/dist/dynamicForms-tYQog0kw.js +0 -298
- package/dist/ekybModule-C33C4JES.js +0 -237
- package/dist/ekybModule-LON6G2Bz.js +0 -2
- package/dist/ekycModule-BJOgtTAh.js +0 -225
- package/dist/ekycModule-BSf_DIG7.js +0 -2
- package/dist/electronic-signature-OdgTyso4.js +0 -406
- package/dist/emailInput-CU7mLB21.js +0 -37
- package/dist/errorIcon-DpHzAoAo.js +0 -24
- package/dist/expiredId-nfVAZgTL.js +0 -70
- package/dist/extensibility-BbNy3mVG.js +0 -2602
- package/dist/faceMatch-BIila4kf.js +0 -2
- package/dist/faceMatch-DJ7Mqujx.js +0 -206
- package/dist/fieldComparison-D2RSFYl-.js +0 -84
- package/dist/fieldComparison-DbUyouFd.js +0 -2
- package/dist/frontdevicelottie-65Vyfpff.js +0 -17302
- package/dist/glaredevicelottie-BEyaqtc6.js +0 -14466
- package/dist/homeScreen-CyPddxWl.js +0 -227
- package/dist/hooks-MxHtZWTS.js +0 -112
- package/dist/i18n-Kzzvkz94.js +0 -2019
- package/dist/icons-9I5g9-_1.js +0 -292
- package/dist/id-laser-h-iCPbFixz.js +0 -467
- package/dist/id-laser-v-CNzwliP2.js +0 -483
- package/dist/id-tutorial-CF4nO4oX.js +0 -13153
- package/dist/idOcr-DlMLMDqa.js +0 -97
- package/dist/incode-logo-DX016usY.js +0 -4
- package/dist/incodeComponent-BoFhgK7G.js +0 -50
- package/dist/incodeModule-BiCoAJ5k.js +0 -13
- package/dist/inputComposed-DAEey9xm.js +0 -94
- package/dist/inputComposed-eS4B0Mkh.js +0 -1
- package/dist/loadingIcon-BN5YRQUb.js +0 -104
- package/dist/lottie_light-DLqSnziX.js +0 -4419
- package/dist/mandatoryConsent-DNz2jZ43.js +0 -98
- package/dist/modal-ZqAhwiRF.js +0 -135
- package/dist/modal.hooks-LdusROLW.js +0 -126
- package/dist/numberedStep-CdLWASwL.js +0 -11
- package/dist/optionAccessibleLabel-DcygPaME.js +0 -140
- package/dist/otpInput-C4pk4BJU.js +0 -157
- package/dist/page-DA3R7q0J.js +0 -69
- package/dist/pdf-51QeiFSx.js +0 -14967
- package/dist/pdfViewer-rKzTHket.js +0 -64
- package/dist/phoneInputComposed-CjAxk2Gj.js +0 -11230
- package/dist/processing-DPktVde2.js +0 -6
- package/dist/radioGroupComposed-DRRxVk9Z.js +0 -178
- package/dist/registerIncodeElement-BHWOwdSS.js +0 -7
- package/dist/requiredLabelHint-B6FN3v88.js +0 -13
- package/dist/richText-6pIbydcz.js +0 -1973
- package/dist/rolldown-runtime-CYMK-g2i.js +0 -20
- package/dist/selfieTutorial-Yo9AlUoT.js +0 -2677
- package/dist/snackbar-CQiiWO4p.js +0 -14
- package/dist/spinner-B4dcie2T.js +0 -1
- package/dist/spinner-CKnjVHxw.js +0 -39
- package/dist/statusPage-B8b3Jg6N.js +0 -28
- package/dist/successIcon-SlKgTSty.js +0 -28
- package/dist/tabs-D7lGst3Q.js +0 -78
- package/dist/transitionSpinner-Di3bOyOu.js +0 -17
- package/dist/typography-CxjaknHN.js +0 -28
- package/dist/uiConfig-CwpQ-IM6.js +0 -20
- package/dist/useModuleLoader-Bqs7fglI.js +0 -517
- package/dist/vendor-preact-D6SntenC.js +0 -958
- package/dist/verificationResult-DhT3hH1b.js +0 -90
- package/dist/verifiedByIncode-DpbxzO0y.js +0 -101
- package/dist/watchlistForBusiness-CRXVbH4l.js +0 -75
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { v as
|
|
2
|
-
import { c as
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import { createIdVerificationManager
|
|
1
|
+
import { v as u } from "../vendor-preact-BH7vOa2r.js";
|
|
2
|
+
import { c as useManager, o as useModuleTerminalCallbacks } from "../hooks-BtgmGvba.js";
|
|
3
|
+
import { t as IncodeComponent } from "../incodeComponent-CDJxFZvS.js";
|
|
4
|
+
import { t as Spinner } from "../spinner-BfBIZkDQ.js";
|
|
5
|
+
import { t as ExpiredId } from "../expiredId-C105HVKv.js";
|
|
6
|
+
import { t as registerIncodeModuleElement } from "../incodeModule-DkA_yd0X.js";
|
|
7
|
+
import { createIdVerificationManager } from "@incodetech/core/id-verification";
|
|
8
8
|
//#region src/modules/id-verification/id-verification.tsx
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
status:
|
|
13
|
-
onFinish
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
var IdVerificationContent = ({ config, onFinish }) => {
|
|
10
|
+
const [state, manager] = useManager(() => createIdVerificationManager({ config }));
|
|
11
|
+
useModuleTerminalCallbacks({
|
|
12
|
+
status: state.status === "finished" ? "finished" : "loading",
|
|
13
|
+
onFinish
|
|
14
|
+
});
|
|
15
|
+
if (state.status === "expired") return /* @__PURE__ */ u(ExpiredId, { onContinue: () => manager.continue() });
|
|
16
|
+
return /* @__PURE__ */ u(Spinner, { fullScreen: true });
|
|
17
|
+
};
|
|
18
|
+
var IdVerification = ({ config, onFinish }) => /* @__PURE__ */ u(IncodeComponent, { children: config ? /* @__PURE__ */ u(IdVerificationContent, {
|
|
19
|
+
config,
|
|
20
|
+
onFinish
|
|
18
21
|
}) : null });
|
|
19
|
-
|
|
22
|
+
registerIncodeModuleElement(IdVerification, "incode-id-verification");
|
|
20
23
|
//#endregion
|
|
21
|
-
export {
|
|
24
|
+
export { IdVerification };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { n as useTranslation } from "./i18n-gTHArCl9.js";
|
|
2
|
+
import { d as T, v as u } from "./vendor-preact-BH7vOa2r.js";
|
|
3
|
+
import { c as useManager, o as useModuleTerminalCallbacks } from "./hooks-BtgmGvba.js";
|
|
4
|
+
import { t as IncodeComponent } from "./incodeComponent-CDJxFZvS.js";
|
|
5
|
+
import { t as Page } from "./page-BZ-0eNWq.js";
|
|
6
|
+
import "./extensibility-DJwVxojG.js";
|
|
7
|
+
import { t as Button } from "./button-B-qlr4iI.js";
|
|
8
|
+
import { t as VerificationResult } from "./verificationResult-CJ0JyV6A.js";
|
|
9
|
+
import { t as InputComposed } from "./inputComposed-5V2nLTqH.js";
|
|
10
|
+
import { t as RadioGroupComposed } from "./radioGroupComposed-DwYW-Ld-.js";
|
|
11
|
+
import { t as DateInputComposed } from "./dateInputComposed-DY97tQVK.js";
|
|
12
|
+
import { t as registerIncodeModuleElement } from "./incodeModule-DkA_yd0X.js";
|
|
13
|
+
import { n as getRequiredHintMode, t as getFieldHint } from "./requiredLabelHint-DEadtiwx.js";
|
|
14
|
+
import { createIdOcrManager, getOcrFields } from "@incodetech/core/id-ocr";
|
|
15
|
+
//#region src/modules/id-ocr/idOcrForm.tsx
|
|
16
|
+
var TEXT_FIELD_COMPONENTS = {
|
|
17
|
+
text: InputComposed,
|
|
18
|
+
date: DateInputComposed
|
|
19
|
+
};
|
|
20
|
+
var IdOcrForm = ({ fields, data, validationErrors, isReadonly, onChange, onBlur, onContinue }) => {
|
|
21
|
+
const { t } = useTranslation();
|
|
22
|
+
const hasValidationErrors = validationErrors && Object.keys(validationErrors).length > 0;
|
|
23
|
+
const visibleFields = fields.filter((field) => {
|
|
24
|
+
if (field.key === "issuingCountry") return isReadonly === true;
|
|
25
|
+
if (field.key === "documentNumber" && isReadonly) return !!data.documentNumber;
|
|
26
|
+
return true;
|
|
27
|
+
});
|
|
28
|
+
const mode = T(() => getRequiredHintMode(visibleFields.map((f) => isReadonly ? false : f.required)), [visibleFields, isReadonly]);
|
|
29
|
+
const renderField = (field) => {
|
|
30
|
+
const value = data[field.key] ?? "";
|
|
31
|
+
const fieldErrorKey = validationErrors?.[field.key];
|
|
32
|
+
const fieldError = fieldErrorKey ? t(fieldErrorKey) : void 0;
|
|
33
|
+
const isFieldRequired = isReadonly ? false : field.required;
|
|
34
|
+
const hint = getFieldHint(mode, isFieldRequired);
|
|
35
|
+
const labelHint = hint ? t(`forms.label.${hint}`) : void 0;
|
|
36
|
+
if (field.type === "radio") return /* @__PURE__ */ u(RadioGroupComposed, {
|
|
37
|
+
id: `id-ocr-${field.key}`,
|
|
38
|
+
class: "IncodeIdOcrRadioGroup",
|
|
39
|
+
label: t(field.labelKey),
|
|
40
|
+
labelHint,
|
|
41
|
+
value,
|
|
42
|
+
options: (field.options ?? []).map((option) => ({
|
|
43
|
+
value: option.value,
|
|
44
|
+
label: t(option.label)
|
|
45
|
+
})),
|
|
46
|
+
required: isFieldRequired,
|
|
47
|
+
disabled: isReadonly,
|
|
48
|
+
onChange: (next) => onChange(field.key, next)
|
|
49
|
+
}, field.key);
|
|
50
|
+
const Component = TEXT_FIELD_COMPONENTS[field.type];
|
|
51
|
+
const max = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
52
|
+
return /* @__PURE__ */ u(Component, {
|
|
53
|
+
id: `id-ocr-${field.key}`,
|
|
54
|
+
label: t(field.labelKey),
|
|
55
|
+
labelHint,
|
|
56
|
+
value,
|
|
57
|
+
disabled: isReadonly,
|
|
58
|
+
required: isFieldRequired,
|
|
59
|
+
error: fieldError,
|
|
60
|
+
showErrorIcon: !!fieldError,
|
|
61
|
+
onInput: (e) => onChange(field.key, e.target.value),
|
|
62
|
+
onBlur: isReadonly || !onBlur ? void 0 : () => onBlur(field.key),
|
|
63
|
+
...field.type === "date" && { max }
|
|
64
|
+
}, field.key);
|
|
65
|
+
};
|
|
66
|
+
return /* @__PURE__ */ u("div", {
|
|
67
|
+
className: "IncodeIdOcrForm",
|
|
68
|
+
children: [visibleFields.map(renderField), /* @__PURE__ */ u("div", {
|
|
69
|
+
className: "IncodeIdOcrButton",
|
|
70
|
+
children: /* @__PURE__ */ u(Button, {
|
|
71
|
+
onClick: onContinue,
|
|
72
|
+
disabled: hasValidationErrors,
|
|
73
|
+
children: t("common.continue")
|
|
74
|
+
})
|
|
75
|
+
})]
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/modules/id-ocr/idOcr.tsx
|
|
80
|
+
var IdOcrContent = ({ config, onFinish }) => {
|
|
81
|
+
const { t } = useTranslation();
|
|
82
|
+
const [state, manager] = useManager(() => createIdOcrManager({ config }));
|
|
83
|
+
useModuleTerminalCallbacks({
|
|
84
|
+
status: state.status === "finished" ? "finished" : "loading",
|
|
85
|
+
onFinish
|
|
86
|
+
});
|
|
87
|
+
if (state.status === "finished") return null;
|
|
88
|
+
if (state.status === "success") return /* @__PURE__ */ u(VerificationResult, {
|
|
89
|
+
status: "success",
|
|
90
|
+
successTitle: t("idOcr.successTitle")
|
|
91
|
+
});
|
|
92
|
+
if (state.status === "error") return /* @__PURE__ */ u(VerificationResult, {
|
|
93
|
+
status: "failure",
|
|
94
|
+
onRetry: () => manager.retry()
|
|
95
|
+
});
|
|
96
|
+
if (state.status === "loading" || state.status === "submitting") return /* @__PURE__ */ u(VerificationResult, {
|
|
97
|
+
status: "submitting",
|
|
98
|
+
submittingTitle: t("common.holdOnASec"),
|
|
99
|
+
submittingSubtitle: t("idOcr.loadingSubtitle")
|
|
100
|
+
});
|
|
101
|
+
if (state.status === "readonly" || state.status === "inputting") return /* @__PURE__ */ u(Page, {
|
|
102
|
+
title: t("idOcr.title"),
|
|
103
|
+
className: "IncodeIdOcrPage",
|
|
104
|
+
hideFooterBranding: true,
|
|
105
|
+
children: /* @__PURE__ */ u(IdOcrForm, {
|
|
106
|
+
fields: getOcrFields(config),
|
|
107
|
+
data: state.formData,
|
|
108
|
+
validationErrors: state.status === "inputting" ? state.validationErrors : void 0,
|
|
109
|
+
isReadonly: state.status === "readonly",
|
|
110
|
+
onChange: (field, value) => manager.setField(field, value),
|
|
111
|
+
onBlur: state.status === "inputting" ? (field) => manager.validateField(field) : void 0,
|
|
112
|
+
onContinue: () => manager.continue()
|
|
113
|
+
}, state.ocrDocument)
|
|
114
|
+
});
|
|
115
|
+
return null;
|
|
116
|
+
};
|
|
117
|
+
var IdOcr = ({ config, onFinish }) => /* @__PURE__ */ u(IncodeComponent, { children: config ? /* @__PURE__ */ u(IdOcrContent, {
|
|
118
|
+
config,
|
|
119
|
+
onFinish
|
|
120
|
+
}) : null });
|
|
121
|
+
registerIncodeModuleElement(IdOcr, "incode-id-ocr");
|
|
122
|
+
//#endregion
|
|
123
|
+
export { IdOcr };
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { c as
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import { SCAN_NEW_DOCUMENT
|
|
1
|
+
import { n as useTranslation } from "../i18n-gTHArCl9.js";
|
|
2
|
+
import { _ as y, v as u } from "../vendor-preact-BH7vOa2r.js";
|
|
3
|
+
import { c as useManager, o as useModuleTerminalCallbacks } from "../hooks-BtgmGvba.js";
|
|
4
|
+
import { t as IncodeComponent } from "../incodeComponent-CDJxFZvS.js";
|
|
5
|
+
import { t as Page } from "../page-BZ-0eNWq.js";
|
|
6
|
+
import { t as Spinner } from "../spinner-BfBIZkDQ.js";
|
|
7
|
+
import { t as Button } from "../button-B-qlr4iI.js";
|
|
8
|
+
import { t as registerIncodeModuleElement } from "../incodeModule-DkA_yd0X.js";
|
|
9
|
+
import { SCAN_NEW_DOCUMENT, createIdentityReuseManager } from "@incodetech/core/identity-reuse";
|
|
10
10
|
//#region src/modules/identity-reuse/identity-reuse.tsx
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* ISO 3166-1 alpha-3 → alpha-2 mapping for countries the SDK supports.
|
|
13
|
+
* The identity-reuse backend returns alpha-3 codes; flag rendering needs
|
|
14
|
+
* alpha-2. Extend as backend support expands; unmapped codes fall back to "".
|
|
15
|
+
*/
|
|
16
|
+
var ISO3_TO_ISO2 = {
|
|
12
17
|
USA: "US",
|
|
13
18
|
MEX: "MX",
|
|
14
19
|
CAN: "CA",
|
|
@@ -100,190 +105,223 @@ var f = {
|
|
|
100
105
|
MLT: "MT",
|
|
101
106
|
CYP: "CY"
|
|
102
107
|
};
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
/** Convert an ISO-2 or ISO-3 country code to a flag emoji. */
|
|
109
|
+
function countryCodeToFlag(countryCode) {
|
|
110
|
+
if (!countryCode) return "";
|
|
111
|
+
const upper = countryCode.toUpperCase();
|
|
112
|
+
const iso2 = upper.length === 3 ? ISO3_TO_ISO2[upper] ?? "" : upper;
|
|
113
|
+
if (iso2.length !== 2) return "";
|
|
114
|
+
const A_OFFSET = 127462 - "A".charCodeAt(0);
|
|
115
|
+
return String.fromCodePoint(iso2.charCodeAt(0) + A_OFFSET, iso2.charCodeAt(1) + A_OFFSET);
|
|
109
116
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
117
|
+
/**
|
|
118
|
+
* Format a backend verification timestamp as a locale-aware short date
|
|
119
|
+
* (e.g. "15 Apr 2023" in en-US). Auto-detects unit: values >= 1e12 are
|
|
120
|
+
* treated as milliseconds, smaller values as unix seconds (the documents
|
|
121
|
+
* API returns seconds, possibly with fractional millis). Returns null if
|
|
122
|
+
* the value can't be parsed so the caller can hide the row instead of
|
|
123
|
+
* rendering a half-empty "Verified" with no date.
|
|
124
|
+
*/
|
|
125
|
+
function formatVerifiedAt(timestamp, locale) {
|
|
126
|
+
if (!Number.isFinite(timestamp) || timestamp <= 0) return null;
|
|
127
|
+
const ms = timestamp >= 0xe8d4a51000 ? timestamp : timestamp * 1e3;
|
|
128
|
+
const date = new Date(ms);
|
|
129
|
+
if (Number.isNaN(date.getTime())) return null;
|
|
130
|
+
return new Intl.DateTimeFormat(locale, {
|
|
114
131
|
day: "2-digit",
|
|
115
132
|
month: "short",
|
|
116
133
|
year: "numeric"
|
|
117
|
-
}).format(
|
|
134
|
+
}).format(date);
|
|
118
135
|
}
|
|
119
|
-
var
|
|
120
|
-
class: `IncodeIdentityReuseRadio ${
|
|
136
|
+
var RadioDot = ({ checked }) => /* @__PURE__ */ u("span", {
|
|
137
|
+
class: `IncodeIdentityReuseRadio ${checked ? "IncodeIdentityReuseRadioChecked" : ""}`,
|
|
121
138
|
"aria-hidden": "true",
|
|
122
|
-
children:
|
|
123
|
-
})
|
|
124
|
-
|
|
125
|
-
|
|
139
|
+
children: checked ? /* @__PURE__ */ u("span", { class: "IncodeIdentityReuseRadioInner" }) : null
|
|
140
|
+
});
|
|
141
|
+
var DocumentCard = ({ document, selected, recommended, tabIndex, onSelect, locale }) => {
|
|
142
|
+
const { t } = useTranslation();
|
|
143
|
+
const typeLabel = t(`identityReuse.documentType.${document.documentType}`);
|
|
144
|
+
const flag = countryCodeToFlag(document.countryCode);
|
|
145
|
+
const verifiedDate = formatVerifiedAt(document.verifiedAt, locale);
|
|
146
|
+
const verifiedWord = t("identityReuse.verified", { defaultValue: "Verified" });
|
|
147
|
+
const verifiedLabel = verifiedDate ? `${verifiedWord} ${verifiedDate}` : null;
|
|
148
|
+
return /* @__PURE__ */ u("button", {
|
|
126
149
|
type: "button",
|
|
127
|
-
class: `IncodeIdentityReuseCard ${
|
|
150
|
+
class: `IncodeIdentityReuseCard ${selected ? "IncodeIdentityReuseCardSelected" : ""}`,
|
|
128
151
|
role: "radio",
|
|
129
|
-
"aria-checked":
|
|
130
|
-
tabIndex
|
|
131
|
-
onClick:
|
|
132
|
-
"data-testid": `identity-reuse-document-${
|
|
133
|
-
children: /* @__PURE__ */
|
|
152
|
+
"aria-checked": selected,
|
|
153
|
+
tabIndex,
|
|
154
|
+
onClick: onSelect,
|
|
155
|
+
"data-testid": `identity-reuse-document-${document.id}`,
|
|
156
|
+
children: /* @__PURE__ */ u("div", {
|
|
134
157
|
class: "IncodeIdentityReuseCardBody",
|
|
135
158
|
children: [
|
|
136
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ u("div", {
|
|
137
160
|
class: "IncodeIdentityReuseCardHeader",
|
|
138
|
-
children: [/* @__PURE__ */
|
|
161
|
+
children: [/* @__PURE__ */ u("div", {
|
|
139
162
|
class: "IncodeIdentityReuseCardHeaderLeft",
|
|
140
|
-
children: [/* @__PURE__ */
|
|
163
|
+
children: [/* @__PURE__ */ u("span", {
|
|
141
164
|
class: "IncodeIdentityReuseCardTypeLabel",
|
|
142
|
-
children:
|
|
143
|
-
}),
|
|
165
|
+
children: typeLabel
|
|
166
|
+
}), recommended ? /* @__PURE__ */ u("span", {
|
|
144
167
|
class: "IncodeIdentityReuseBadgeRecommended",
|
|
145
|
-
children:
|
|
168
|
+
children: t("identityReuse.badge.recommended")
|
|
146
169
|
}) : null]
|
|
147
|
-
}), /* @__PURE__ */
|
|
170
|
+
}), /* @__PURE__ */ u(RadioDot, { checked: selected })]
|
|
148
171
|
}),
|
|
149
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ u("p", {
|
|
150
173
|
class: "IncodeIdentityReuseCardIdentifier",
|
|
151
|
-
children: [
|
|
174
|
+
children: [flag ? /* @__PURE__ */ u("span", {
|
|
152
175
|
"aria-hidden": "true",
|
|
153
|
-
children:
|
|
154
|
-
}) : null, /* @__PURE__ */
|
|
176
|
+
children: flag
|
|
177
|
+
}) : null, /* @__PURE__ */ u("span", { children: document.maskedNumber })]
|
|
155
178
|
}),
|
|
156
|
-
|
|
179
|
+
verifiedLabel ? /* @__PURE__ */ u("p", {
|
|
157
180
|
class: "IncodeIdentityReuseCardVerified",
|
|
158
|
-
children:
|
|
181
|
+
children: verifiedLabel
|
|
159
182
|
}) : null
|
|
160
183
|
]
|
|
161
184
|
})
|
|
162
185
|
});
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
|
|
186
|
+
};
|
|
187
|
+
var ScanNewRow = ({ selected, tabIndex, onSelect }) => {
|
|
188
|
+
const { t } = useTranslation();
|
|
189
|
+
return /* @__PURE__ */ u("button", {
|
|
166
190
|
type: "button",
|
|
167
|
-
class: `IncodeIdentityReuseCard IncodeIdentityReuseScanNewCard ${
|
|
191
|
+
class: `IncodeIdentityReuseCard IncodeIdentityReuseScanNewCard ${selected ? "IncodeIdentityReuseCardSelected" : ""}`,
|
|
168
192
|
role: "radio",
|
|
169
|
-
"aria-checked":
|
|
170
|
-
tabIndex
|
|
171
|
-
onClick:
|
|
193
|
+
"aria-checked": selected,
|
|
194
|
+
tabIndex,
|
|
195
|
+
onClick: onSelect,
|
|
172
196
|
"data-testid": "identity-reuse-scan-new",
|
|
173
|
-
children: [/* @__PURE__ */
|
|
197
|
+
children: [/* @__PURE__ */ u("div", {
|
|
174
198
|
class: "IncodeIdentityReuseScanNewBody",
|
|
175
|
-
children: [/* @__PURE__ */
|
|
199
|
+
children: [/* @__PURE__ */ u("span", {
|
|
176
200
|
class: "IncodeIdentityReuseCardTypeLabel",
|
|
177
|
-
children:
|
|
178
|
-
}), /* @__PURE__ */
|
|
201
|
+
children: t("identityReuse.scanANewDocument")
|
|
202
|
+
}), /* @__PURE__ */ u("span", {
|
|
179
203
|
class: "IncodeIdentityReuseBadgeSlowest",
|
|
180
|
-
children:
|
|
204
|
+
children: t("identityReuse.badge.slowest")
|
|
181
205
|
})]
|
|
182
|
-
}), /* @__PURE__ */
|
|
206
|
+
}), /* @__PURE__ */ u(RadioDot, { checked: selected })]
|
|
183
207
|
});
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
208
|
+
};
|
|
209
|
+
var IdentityReuseContent = ({ config, manager: externalManager, onFinish, onError }) => {
|
|
210
|
+
const { t, i18n } = useTranslation();
|
|
211
|
+
const locale = i18n.language || "en";
|
|
212
|
+
const [state, manager] = useManager(() => {
|
|
213
|
+
if (externalManager) return externalManager;
|
|
214
|
+
if (!config) throw new Error("IdentityReuse config is required when no manager is provided");
|
|
215
|
+
return createIdentityReuseManager({ config });
|
|
216
|
+
}, { manageLifecycle: !externalManager });
|
|
217
|
+
useModuleTerminalCallbacks({
|
|
218
|
+
status: state.status === "finished" ? "finished" : "loading",
|
|
219
|
+
onFinish
|
|
193
220
|
});
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}, [
|
|
198
|
-
if (
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
221
|
+
const errorMessage = state.status === "error" ? state.error : void 0;
|
|
222
|
+
y(() => {
|
|
223
|
+
if (errorMessage) onError?.(errorMessage);
|
|
224
|
+
}, [errorMessage, onError]);
|
|
225
|
+
if (state.status === "idle" || state.status === "loading" || state.status === "submitting") return /* @__PURE__ */ u(Spinner, { title: t("identityReuse.loading") });
|
|
226
|
+
if (state.status === "documentsFound") {
|
|
227
|
+
const selectedId = state.selectedDocumentId;
|
|
228
|
+
const optionIds = [...state.documents.map((d) => d.id), SCAN_NEW_DOCUMENT];
|
|
229
|
+
const focusedIndex = selectedId === void 0 ? 0 : Math.max(0, optionIds.findIndex((id) => id === selectedId));
|
|
230
|
+
const ctaLabel = selectedId === SCAN_NEW_DOCUMENT ? t("identityReuse.cta.scanNew") : t("identityReuse.cta.confirm");
|
|
231
|
+
const handleRadiogroupKeyDown = (event) => {
|
|
232
|
+
const container = event.currentTarget;
|
|
233
|
+
if (!container) return;
|
|
234
|
+
const buttons = container.querySelectorAll("[role=\"radio\"]");
|
|
235
|
+
if (buttons.length === 0) return;
|
|
236
|
+
const currentIndex = Array.from(buttons).findIndex((b) => b === document.activeElement);
|
|
237
|
+
if (currentIndex === -1) return;
|
|
238
|
+
let nextIndex = currentIndex;
|
|
239
|
+
switch (event.key) {
|
|
208
240
|
case "ArrowDown":
|
|
209
241
|
case "ArrowRight":
|
|
210
|
-
|
|
242
|
+
nextIndex = (currentIndex + 1) % buttons.length;
|
|
211
243
|
break;
|
|
212
244
|
case "ArrowUp":
|
|
213
245
|
case "ArrowLeft":
|
|
214
|
-
|
|
246
|
+
nextIndex = (currentIndex - 1 + buttons.length) % buttons.length;
|
|
215
247
|
break;
|
|
216
248
|
case "Home":
|
|
217
|
-
|
|
249
|
+
nextIndex = 0;
|
|
218
250
|
break;
|
|
219
251
|
case "End":
|
|
220
|
-
|
|
252
|
+
nextIndex = buttons.length - 1;
|
|
221
253
|
break;
|
|
222
254
|
default: return;
|
|
223
255
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
256
|
+
event.preventDefault();
|
|
257
|
+
const next = buttons[nextIndex];
|
|
258
|
+
if (next) {
|
|
259
|
+
next.focus();
|
|
260
|
+
next.click();
|
|
261
|
+
}
|
|
227
262
|
};
|
|
228
|
-
return /* @__PURE__ */
|
|
263
|
+
return /* @__PURE__ */ u(Page, {
|
|
229
264
|
className: "IncodeIdentityReusePage",
|
|
230
|
-
title:
|
|
231
|
-
subtitle:
|
|
232
|
-
children: /* @__PURE__ */
|
|
265
|
+
title: t("identityReuse.title"),
|
|
266
|
+
subtitle: t("identityReuse.subtitle"),
|
|
267
|
+
children: /* @__PURE__ */ u("div", {
|
|
233
268
|
class: "IncodeIdentityReuseBody",
|
|
234
|
-
children: [/* @__PURE__ */
|
|
269
|
+
children: [/* @__PURE__ */ u("div", {
|
|
235
270
|
class: "IncodeIdentityReuseList",
|
|
236
271
|
role: "radiogroup",
|
|
237
|
-
"aria-label":
|
|
238
|
-
onKeyDown:
|
|
239
|
-
children: [
|
|
240
|
-
document
|
|
241
|
-
selected:
|
|
242
|
-
recommended:
|
|
243
|
-
tabIndex:
|
|
244
|
-
onSelect: () =>
|
|
245
|
-
locale
|
|
246
|
-
},
|
|
247
|
-
selected:
|
|
248
|
-
tabIndex:
|
|
249
|
-
onSelect: () =>
|
|
272
|
+
"aria-label": t("identityReuse.title"),
|
|
273
|
+
onKeyDown: handleRadiogroupKeyDown,
|
|
274
|
+
children: [state.documents.map((document, index) => /* @__PURE__ */ u(DocumentCard, {
|
|
275
|
+
document,
|
|
276
|
+
selected: selectedId === document.id,
|
|
277
|
+
recommended: index === 0,
|
|
278
|
+
tabIndex: index === focusedIndex ? 0 : -1,
|
|
279
|
+
onSelect: () => manager.chooseDocument(document.id),
|
|
280
|
+
locale
|
|
281
|
+
}, document.id)), /* @__PURE__ */ u(ScanNewRow, {
|
|
282
|
+
selected: selectedId === SCAN_NEW_DOCUMENT,
|
|
283
|
+
tabIndex: focusedIndex === state.documents.length ? 0 : -1,
|
|
284
|
+
onSelect: () => manager.chooseDocument(SCAN_NEW_DOCUMENT)
|
|
250
285
|
})]
|
|
251
|
-
}), /* @__PURE__ */
|
|
286
|
+
}), /* @__PURE__ */ u("div", {
|
|
252
287
|
class: "IncodeIdentityReuseActions",
|
|
253
|
-
children: /* @__PURE__ */
|
|
254
|
-
onClick: () =>
|
|
255
|
-
disabled:
|
|
288
|
+
children: /* @__PURE__ */ u(Button, {
|
|
289
|
+
onClick: () => manager.submit(),
|
|
290
|
+
disabled: selectedId === void 0,
|
|
256
291
|
"data-testid": "identity-reuse-confirm-button",
|
|
257
|
-
children:
|
|
292
|
+
children: ctaLabel
|
|
258
293
|
})
|
|
259
294
|
})]
|
|
260
295
|
})
|
|
261
296
|
});
|
|
262
297
|
}
|
|
263
|
-
|
|
298
|
+
if (state.status === "error") return /* @__PURE__ */ u(Page, {
|
|
264
299
|
className: "IncodeIdentityReusePage",
|
|
265
|
-
title:
|
|
266
|
-
subtitle:
|
|
267
|
-
children: [/* @__PURE__ */
|
|
300
|
+
title: t("identityReuse.errorTitle"),
|
|
301
|
+
subtitle: state.error,
|
|
302
|
+
children: [/* @__PURE__ */ u("div", { class: "IncodeIdentityReuseContent" }), /* @__PURE__ */ u("div", {
|
|
268
303
|
class: "IncodeIdentityReuseActions",
|
|
269
|
-
children: [/* @__PURE__ */
|
|
270
|
-
onClick: () =>
|
|
304
|
+
children: [/* @__PURE__ */ u(Button, {
|
|
305
|
+
onClick: () => manager.retry(),
|
|
271
306
|
"data-testid": "identity-reuse-retry-button",
|
|
272
|
-
children:
|
|
273
|
-
}), /* @__PURE__ */
|
|
274
|
-
onClick: () =>
|
|
307
|
+
children: t("identityReuse.cta.retry")
|
|
308
|
+
}), /* @__PURE__ */ u(Button, {
|
|
309
|
+
onClick: () => manager.skip(),
|
|
275
310
|
variant: "link",
|
|
276
311
|
"data-testid": "identity-reuse-skip-button",
|
|
277
|
-
children:
|
|
312
|
+
children: t("identityReuse.cta.skip")
|
|
278
313
|
})]
|
|
279
314
|
})]
|
|
280
|
-
})
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
315
|
+
});
|
|
316
|
+
if (state.status === "finished") return null;
|
|
317
|
+
return null;
|
|
318
|
+
};
|
|
319
|
+
var IdentityReuse = ({ config, manager, onFinish, onError }) => /* @__PURE__ */ u(IncodeComponent, { children: config || manager ? /* @__PURE__ */ u(IdentityReuseContent, {
|
|
320
|
+
config,
|
|
321
|
+
manager,
|
|
322
|
+
onFinish,
|
|
323
|
+
onError
|
|
286
324
|
}) : null });
|
|
287
|
-
|
|
325
|
+
registerIncodeModuleElement(IdentityReuse, "incode-identity-reuse");
|
|
288
326
|
//#endregion
|
|
289
|
-
export {
|
|
327
|
+
export { IdentityReuse };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/shared/page/incode-logo.svg
|
|
2
|
+
var incode_logo_default = "data:image/svg+xml,%3csvg%20width='76'%20height='20'%20viewBox='0%200%2076%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M40.1687%206.01811C42.2312%206.01811%2043.7927%206.59655%2044.8446%207.76024C45.8919%208.91831%2046.4126%2010.5865%2046.4126%2012.7583C46.4126%2014.93%2045.8748%2016.6105%2044.794%2017.7944C43.7102%2018.9815%2042.1729%2019.5735%2040.1937%2019.5735C38.1479%2019.5735%2036.5973%2018.99%2035.5546%2017.8187L35.4273%2017.6701C34.4729%2016.5101%2033.9984%2014.871%2033.9984%2012.7583C33.9984%208.28671%2036.0703%206.01811%2040.1687%206.01811ZM69.1127%206.01781C71.1144%206.01781%2072.5953%206.66904%2073.5373%207.97333C74.4288%209.2077%2074.8837%2010.9053%2074.9066%2013.0629L74.9058%2013.5242H66.1149C66.2174%2014.6334%2066.5602%2015.4734%2067.141%2016.0538C67.7488%2016.662%2068.6195%2016.9679%2069.7639%2016.9679C70.5188%2016.9679%2071.2373%2016.8742%2071.921%2016.6862C72.6048%2016.4995%2073.2105%2016.2581%2073.735%2015.9646L73.9814%2015.8267V18.666L73.8821%2018.7093C72.5607%2019.286%2071.0464%2019.5732%2069.3379%2019.5732C67.4088%2019.5732%2065.8853%2018.986%2064.7769%2017.8093C63.6699%2016.6348%2063.1183%2014.9722%2063.1183%2012.833C63.1183%2010.6451%2063.6389%208.96055%2064.6862%207.78517C65.7359%206.60632%2067.2157%206.01781%2069.1127%206.01781ZM60.3976%201.06738V16.3832C60.3976%2017.0998%2060.0996%2017.7092%2059.5124%2018.198C58.9425%2018.6724%2058.2282%2019.0207%2057.3718%2019.2435C56.5257%2019.4635%2055.6531%2019.5731%2054.7534%2019.5731C52.9298%2019.5731%2051.4237%2019.056%2050.2406%2018.0202C49.0485%2016.9752%2048.4588%2015.1678%2048.4588%2012.6072C48.4588%2010.5545%2048.9627%208.9421%2049.9753%207.77411C50.9938%206.60175%2052.4982%206.01774%2054.4782%206.01774C54.9416%206.01774%2055.4735%206.07665%2056.0742%206.19449C56.582%206.296%2057.0453%206.43849%2057.4648%206.62252V1.06738H60.3976ZM27.911%206.04223C29.2828%206.04223%2030.5881%206.29619%2031.8264%206.80393L31.9291%206.84604V9.55797L31.6992%209.46109C30.4503%208.93473%2029.3127%208.67257%2028.2863%208.67257C27.0102%208.67257%2026.0684%208.98809%2025.4521%209.61162C24.8366%2010.2352%2024.5242%2011.2397%2024.5242%2012.6331C24.5242%2014.0959%2024.8298%2015.1535%2025.4314%2015.8092C26.029%2016.4619%2027.002%2016.7923%2028.3613%2016.7923C29.4706%2016.7923%2030.589%2016.5234%2031.7164%2015.9842L31.9534%2015.8708V18.5903L31.8552%2018.634C30.6349%2019.1773%2029.3283%2019.4483%2027.936%2019.4483C26.2154%2019.4483%2024.7637%2018.9753%2023.5868%2018.0285L23.4123%2017.8829L23.2796%2017.7636C22.1516%2016.7067%2021.5914%2015.0592%2021.5914%2012.8332C21.5914%2010.4557%2022.186%208.72379%2023.3849%207.64725C24.5757%206.57726%2026.0871%206.04223%2027.911%206.04223ZM4.11045%206.39262L4.13613%2019.1987H1.15293V6.39262H4.11045ZM13.5766%206.0423C15.365%206.0423%2016.6948%206.41948%2017.5636%207.18368C18.4372%207.95269%2018.8706%209.13902%2018.8706%2010.7331V19.1984H15.9127V11.0838C15.9127%209.42945%2014.9988%208.62337%2013.1013%208.62337C12.3086%208.62337%2011.5458%208.73548%2010.8133%208.95959L10.5401%209.04888V19.1984H7.58147V7.40579L7.67177%207.35974C8.43481%206.97061%209.36013%206.65415%2010.4506%206.40815L10.8116%206.33134C11.7692%206.13867%2012.6905%206.0423%2013.5766%206.0423ZM40.1687%208.5477C39.0014%208.5477%2038.1814%208.89722%2037.6896%209.59114C37.1869%2010.3012%2036.932%2011.3564%2036.932%2012.7583C36.932%2014.1602%2037.1948%2015.223%2037.7142%2015.9499C38.2224%2016.6613%2039.0345%2017.0182%2040.1687%2017.0182C42.3685%2017.0182%2043.4555%2015.6249%2043.4555%2012.7583C43.4555%2011.325%2043.1888%2010.2632%2042.6636%209.57056C42.1472%208.89036%2041.3203%208.5477%2040.1687%208.5477ZM54.8535%208.59807C52.5835%208.59807%2051.4659%209.9271%2051.4659%2012.6579C51.4659%2014.0276%2051.7253%2015.0917%2052.2391%2015.8527C52.7378%2016.5945%2053.6185%2016.9678%2054.9035%2016.9678C55.6556%2016.9678%2056.2834%2016.8792%2056.7876%2016.7028C57.2156%2016.553%2057.4279%2016.378%2057.4604%2016.186L57.4648%2016.1332V9.25404L57.2778%209.15611C56.9611%208.99923%2056.6189%208.87406%2056.2512%208.78123C55.7705%208.65917%2055.3045%208.59807%2054.8535%208.59807ZM69.0377%208.49888C68.192%208.49888%2067.5412%208.71795%2067.0743%209.15366C66.6631%209.5374%2066.3731%2010.1684%2066.2101%2011.0498L66.1771%2011.2425H71.8784L71.8489%2011.0453C71.7111%2010.208%2071.4421%209.58986%2071.0461%209.18626C70.5969%208.72981%2069.9303%208.49888%2069.0377%208.49888ZM4.21085%201.94156V4.64764H1.07715V1.94156H4.21085Z'%20fill='%23006AFF'/%3e%3c/svg%3e";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { incode_logo_default as t };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { n as useTranslation } from "./i18n-gTHArCl9.js";
|
|
2
|
+
import { _ as y, l as A, p as d, r as $, v as u } from "./vendor-preact-BH7vOa2r.js";
|
|
3
|
+
import { s as useScreenOrientation } from "./hooks-BtgmGvba.js";
|
|
4
|
+
import { isIPad } from "@incodetech/core/device";
|
|
5
|
+
//#region src/shared/icons/rotate-icon.svg
|
|
6
|
+
var rotate_icon_default = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='90'%20height='90'%20viewBox='0%200%2090%2090'%3e%3cg%20fill='%2320263D'%3e%3cpath%20d='M84.12%2027.54l-2.58-2.58L65.036%208.456l-2.58-2.58c-3.127-3.127-8.58-2.764-12.157.81L6.69%2050.306c-3.574%203.574-3.938%209.027-.81%2012.158l21.66%2021.66c3.128%203.127%208.58%202.764%2012.157-.81l43.617-43.616c3.574-3.578%203.937-9.03.806-12.158zm-5.524%208.617l-42.439%2042.44c-1.3%201.3-3.28%201.432-4.42.296l-20.63-20.63c-1.14-1.14-1.008-3.12.297-4.42l42.438-42.44c1.302-1.3%203.282-1.432%204.422-.296l1.031%201.032c1.14%201.14%201.009%203.12-.296%204.421-1.302%201.301-1.433%203.281-.297%204.421L69.02%2031.297c1.14%201.14%203.12%201.01%204.421-.296%201.301-1.301%203.281-1.432%204.421-.296l1.031%201.031c1.137%201.14%201.005%203.12-.296%204.421zM51.885%2090a3.135%203.135%200%2001-2.22-5.351l8.925-8.925a3.138%203.138%200%20014.646.233l3.308%204.046c10.114-5.374%2017.081-15.994%2017.178-28.14a3.136%203.136%200%20013.136-3.113h.026a3.14%203.14%200%20013.112%203.161C89.835%2072.746%2072.746%2089.835%2051.911%2090h-.026zM38.115%200a3.135%203.135%200%20012.22%205.351l-8.925%208.925a3.125%203.125%200%2001-2.378.915%203.138%203.138%200%2001-2.272-1.147l-3.308-4.046C13.34%2015.37%206.373%2025.99%206.274%2038.138a3.14%203.14%200%2001-3.139%203.112h-.026a3.139%203.139%200%2001-3.11-3.161C.166%2017.254%2017.255.165%2038.09%200h.026z'/%3e%3c/g%3e%3c/svg%3e";
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/shared/landscapeBlocker/landscapeBlocker.tsx
|
|
9
|
+
function usePortalContainer() {
|
|
10
|
+
const [container, setContainer] = d(null);
|
|
11
|
+
const containerRef = A(null);
|
|
12
|
+
y(() => {
|
|
13
|
+
const el = document.createElement("div");
|
|
14
|
+
el.setAttribute("data-incode-landscape-portal", "");
|
|
15
|
+
document.body.appendChild(el);
|
|
16
|
+
containerRef.current = el;
|
|
17
|
+
setContainer(el);
|
|
18
|
+
return () => {
|
|
19
|
+
el.remove();
|
|
20
|
+
containerRef.current = null;
|
|
21
|
+
};
|
|
22
|
+
}, []);
|
|
23
|
+
return container;
|
|
24
|
+
}
|
|
25
|
+
function LandscapeBlocker() {
|
|
26
|
+
const { t } = useTranslation();
|
|
27
|
+
const container = usePortalContainer();
|
|
28
|
+
if (!container) return null;
|
|
29
|
+
return $(/* @__PURE__ */ u("div", {
|
|
30
|
+
class: "IncodeLandscapeBlocker",
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ u("img", {
|
|
33
|
+
class: "IncodeLandscapeBlocker-icon",
|
|
34
|
+
src: rotate_icon_default,
|
|
35
|
+
alt: "",
|
|
36
|
+
"aria-hidden": true
|
|
37
|
+
}),
|
|
38
|
+
/* @__PURE__ */ u("p", {
|
|
39
|
+
class: "IncodeLandscapeBlocker-text",
|
|
40
|
+
children: t("common.landscape")
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ u("p", {
|
|
43
|
+
class: "IncodeLandscapeBlocker-text",
|
|
44
|
+
children: isIPad() ? t("common.rotateIpad") : t("common.rotate")
|
|
45
|
+
})
|
|
46
|
+
]
|
|
47
|
+
}), container);
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/shared/componentRoot/incodeComponent.tsx
|
|
51
|
+
/**
|
|
52
|
+
* Wraps UI modules with the standard container.
|
|
53
|
+
* Shows a landscape blocker overlay on mobile (excluding iPad) when device is rotated to landscape.
|
|
54
|
+
*/
|
|
55
|
+
function IncodeComponent({ children }) {
|
|
56
|
+
const { isLandscapeMobile } = useScreenOrientation();
|
|
57
|
+
return /* @__PURE__ */ u("div", {
|
|
58
|
+
class: "IncodeComponent",
|
|
59
|
+
children: [children, isLandscapeMobile ? /* @__PURE__ */ u(LandscapeBlocker, {}) : null]
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
export { LandscapeBlocker as n, IncodeComponent as t };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { t as registerIncodeElement } from "./registerIncodeElement-BJJGzVdq.js";
|
|
2
|
+
//#region src/shared/webComponent/incodeModule.ts
|
|
3
|
+
var incodeModulePropKeys = [
|
|
4
|
+
"config",
|
|
5
|
+
"manager",
|
|
6
|
+
"onFinish",
|
|
7
|
+
"onError"
|
|
8
|
+
];
|
|
9
|
+
function registerIncodeModuleElement(component, tagName) {
|
|
10
|
+
registerIncodeElement(component, tagName, incodeModulePropKeys);
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { registerIncodeModuleElement as t };
|