@adyen/kyc-components 3.2.0 → 3.3.1
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/es/ad-e09b987a.mjs +13 -0
- package/dist/es/adyen-kyc-components.es.js +1928 -1486
- package/dist/es/ae-8ca1be27.mjs +10 -0
- package/dist/es/af-342e1bf5.mjs +12 -0
- package/dist/es/ag-997e3f88.mjs +35 -0
- package/dist/es/ai-402dc201.mjs +30 -0
- package/dist/es/al-38b31dad.mjs +14 -0
- package/dist/es/am-bc1403ea.mjs +10 -0
- package/dist/es/an-70336f96.mjs +10 -0
- package/dist/es/ao-eedf3279.mjs +41 -0
- package/dist/es/aq-2220e7e0.mjs +8 -0
- package/dist/es/ar-87abe42d.mjs +9 -0
- package/dist/es/arrow-left-3d6cd330.mjs +5 -0
- package/dist/es/arrow-right-994e40f8.mjs +8 -0
- package/dist/es/as-6e35c5ec.mjs +16 -0
- package/dist/es/at-4310d424.mjs +8 -0
- package/dist/es/au-50f94ba8.mjs +17 -0
- package/dist/es/aw-97918c9f.mjs +24 -0
- package/dist/es/ax-567f3585.mjs +10 -0
- package/dist/es/az-85dbb96d.mjs +19 -0
- package/dist/es/ba-8afe4a33.mjs +18 -0
- package/dist/es/bb-c4d79528.mjs +16 -0
- package/dist/es/bd-0f87f359.mjs +9 -0
- package/dist/es/be-63be2126.mjs +10 -0
- package/dist/es/bf-621f8737.mjs +10 -0
- package/dist/es/bg-30061757.mjs +12 -0
- package/dist/es/bh-a858ad79.mjs +8 -0
- package/dist/es/bi-c08e68ba.mjs +18 -0
- package/dist/es/bin-191739de.mjs +8 -0
- package/dist/es/bj-8e17226d.mjs +28 -0
- package/dist/es/bl-b7b32ae6.mjs +26 -0
- package/dist/es/bm-b728ab56.mjs +31 -0
- package/dist/es/bn-c706c05b.mjs +13 -0
- package/dist/es/bo-1fad8399.mjs +10 -0
- package/dist/es/br-11b9980d.mjs +14 -0
- package/dist/es/bs-090f5bd7.mjs +14 -0
- package/dist/es/bt-c56334d3.mjs +9 -0
- package/dist/es/bv-570dcd11.mjs +20 -0
- package/dist/es/bw-5de93ae1.mjs +10 -0
- package/dist/es/by-e2457131.mjs +14 -0
- package/dist/es/bz-30bbd0de.mjs +11 -0
- package/dist/es/ca-39c0e436.mjs +9 -0
- package/dist/es/cc-ddc2a1db.mjs +14 -0
- package/dist/es/cd-eab01270.mjs +14 -0
- package/dist/es/cf-50f7241b.mjs +12 -0
- package/dist/es/cg-e87aa981.mjs +13 -0
- package/dist/es/ch-9637f347.mjs +9 -0
- package/dist/es/check-b5a70376.mjs +5 -0
- package/dist/es/checkmark-fd78da6f.mjs +5 -0
- package/dist/es/checkmark-small-bf41309f.mjs +5 -0
- package/dist/es/chevron-down-df0a3ac6.mjs +8 -0
- package/dist/es/chevron-right-23ff6e47.mjs +8 -0
- package/dist/es/chevron-up-abfe0e90.mjs +8 -0
- package/dist/es/ci-41814a2b.mjs +9 -0
- package/dist/es/ck-60b0d769.mjs +24 -0
- package/dist/es/cl-931fd7da.mjs +10 -0
- package/dist/es/cm-55c02792.mjs +16 -0
- package/dist/es/cn-1526dac5.mjs +9 -0
- package/dist/es/co-c7ada338.mjs +28 -0
- package/dist/es/company-4f71e406.mjs +5 -0
- package/dist/es/contract-5bc99018.mjs +5 -0
- package/dist/es/controlling-person-88da578f.mjs +5 -0
- package/dist/es/cr-bac1e451.mjs +9 -0
- package/dist/es/cross-c2431982.mjs +8 -0
- package/dist/es/cu-af98b602.mjs +10 -0
- package/dist/es/cv-575fe55b.mjs +11 -0
- package/dist/es/cw-6f1c60ce.mjs +15 -0
- package/dist/es/cx-7687e3a9.mjs +16 -0
- package/dist/es/cy-eeff5dbd.mjs +10 -0
- package/dist/es/cz-24eff96c.mjs +9 -0
- package/dist/es/de-8e2b6f6c.mjs +28 -0
- package/dist/es/decision-maker-a2182544.mjs +5 -0
- package/dist/es/dj-e0f41411.mjs +15 -0
- package/dist/es/dk-a5073c43.mjs +8 -0
- package/dist/es/dm-9a3ee195.mjs +18 -0
- package/dist/es/do-5aa635df.mjs +12 -0
- package/dist/es/document-88abec41.mjs +5 -0
- package/dist/es/download-54b1a163.mjs +8 -0
- package/dist/es/dz-7452e74d.mjs +10 -0
- package/dist/es/ec-c68c940e.mjs +13 -0
- package/dist/es/edit-e3629680.mjs +5 -0
- package/dist/es/ee-1dbd9a40.mjs +9 -0
- package/dist/es/eg-40f9b2b5.mjs +10 -0
- package/dist/es/eh-51f4bae2.mjs +11 -0
- package/dist/es/er-61cda111.mjs +14 -0
- package/dist/es/es-78250575.mjs +13 -0
- package/dist/es/et-63dc8d1e.mjs +12 -0
- package/dist/es/fi-e2d1f3df.mjs +16 -0
- package/dist/es/field-error-620e1903.mjs +5 -0
- package/dist/es/fj-02f497c5.mjs +34 -0
- package/dist/es/fk-56af40af.mjs +41 -0
- package/dist/es/fm-0292f2ce.mjs +19 -0
- package/dist/es/fo-5063373c.mjs +14 -0
- package/dist/es/fr-fb20da2b.mjs +19 -0
- package/dist/es/fx-ca4da212.mjs +9 -0
- package/dist/es/ga-31f5afca.mjs +10 -0
- package/dist/es/gb-4ae48840.mjs +14 -0
- package/dist/es/gd-25e40717.mjs +22 -0
- package/dist/es/ge-939c150e.mjs +9 -0
- package/dist/es/gf-b8736c20.mjs +10 -0
- package/dist/es/gg-4c532713.mjs +13 -0
- package/dist/es/gh-7b187c5f.mjs +11 -0
- package/dist/es/gi-e59b72be.mjs +10 -0
- package/dist/es/gl-31e9b8e5.mjs +9 -0
- package/dist/es/gm-975999b2.mjs +11 -0
- package/dist/es/gn-3701984d.mjs +10 -0
- package/dist/es/gp-40fbae20.mjs +10 -0
- package/dist/es/gq-86021eca.mjs +11 -0
- package/dist/es/gr-3b0c7597.mjs +8 -0
- package/dist/es/gs-00bc8674.mjs +130 -0
- package/dist/es/gt-05eb5f87.mjs +11 -0
- package/dist/es/gu-497f9b0b.mjs +45 -0
- package/dist/es/gw-b54f1365.mjs +11 -0
- package/dist/es/gy-e917fca1.mjs +10 -0
- package/dist/es/hk-ddd60484.mjs +9 -0
- package/dist/es/hm-03a2df0b.mjs +18 -0
- package/dist/es/hn-1748eed1.mjs +9 -0
- package/dist/es/hr-6b1bd9c8.mjs +16 -0
- package/dist/es/ht-13a1ab82.mjs +23 -0
- package/dist/es/hu-81872148.mjs +9 -0
- package/dist/es/id-2c9c4235.mjs +8 -0
- package/dist/es/ie-ef96fd76.mjs +19 -0
- package/dist/es/il-20c3ccd4.mjs +20 -0
- package/dist/es/im-eb7a7143.mjs +40 -0
- package/dist/es/in-67c16223.mjs +11 -0
- package/dist/es/info-circle-3d2e7ba8.mjs +9 -0
- package/dist/es/io-9adeb690.mjs +22 -0
- package/dist/es/iq-61ffc408.mjs +11 -0
- package/dist/es/ir-bc3341c2.mjs +13 -0
- package/dist/es/is-7c19d0ff.mjs +10 -0
- package/dist/es/it-fa0dd04c.mjs +19 -0
- package/dist/es/je-a29e157d.mjs +18 -0
- package/dist/es/jm-53f8ddb8.mjs +13 -0
- package/dist/es/jo-89d49ef8.mjs +11 -0
- package/dist/es/jp-f97d7972.mjs +20 -0
- package/dist/es/ke-545eb9cb.mjs +33 -0
- package/dist/es/kg-066a524e.mjs +10 -0
- package/dist/es/kh-39620e7b.mjs +10 -0
- package/dist/es/ki-900be23e.mjs +17 -0
- package/dist/es/km-b4e8c8ba.mjs +12 -0
- package/dist/es/kn-8ec9ee75.mjs +15 -0
- package/dist/es/kp-1cdc64be.mjs +11 -0
- package/dist/es/kr-53eac37f.mjs +23 -0
- package/dist/es/kw-c4347b38.mjs +10 -0
- package/dist/es/ky-a104dc86.mjs +31 -0
- package/dist/es/kz-d64ba71d.mjs +10 -0
- package/dist/es/la-04577eb2.mjs +10 -0
- package/dist/es/lb-c2470dd0.mjs +19 -0
- package/dist/es/lc-58fb8706.mjs +19 -0
- package/dist/es/li-c887f5b7.mjs +9 -0
- package/dist/es/light-bulb-d403fe24.mjs +5 -0
- package/dist/es/lk-d10f8746.mjs +12 -0
- package/dist/es/location-e7c2a8f5.mjs +5 -0
- package/dist/es/lr-8422af8e.mjs +20 -0
- package/dist/es/ls-bdcefbbc.mjs +11 -0
- package/dist/es/lt-07e70fec.mjs +10 -0
- package/dist/es/lu-b7c93ece.mjs +9 -0
- package/dist/es/lv-97900494.mjs +8 -0
- package/dist/es/ly-86ceab07.mjs +29 -0
- package/dist/es/ma-21b21bdf.mjs +15 -0
- package/dist/es/mc-f23b73f0.mjs +12 -0
- package/dist/es/md-82ed1b49.mjs +17 -0
- package/dist/es/me-c45ff596.mjs +17 -0
- package/dist/es/mf-11563bd1.mjs +10 -0
- package/dist/es/mg-f5f0546b.mjs +9 -0
- package/dist/es/mh-06a860ed.mjs +15 -0
- package/dist/es/mk-91356e13.mjs +12 -0
- package/dist/es/ml-c3f2014e.mjs +16 -0
- package/dist/es/mm-d138bd76.mjs +17 -0
- package/dist/es/mn-9c4664d8.mjs +20 -0
- package/dist/es/mo-54bd2fbe.mjs +16 -0
- package/dist/es/more-horiz-0ca4ec23.mjs +5 -0
- package/dist/es/mp-796516e8.mjs +11 -0
- package/dist/es/mq-3511a92a.mjs +10 -0
- package/dist/es/mr-a4b18b6d.mjs +15 -0
- package/dist/es/ms-91e4dcef.mjs +28 -0
- package/dist/es/mt-9b58b6a6.mjs +21 -0
- package/dist/es/mu-2307760c.mjs +17 -0
- package/dist/es/mv-32c9699b.mjs +16 -0
- package/dist/es/mw-2b9505ac.mjs +17 -0
- package/dist/es/mx-98a49b74.mjs +17 -0
- package/dist/es/my-217f9384.mjs +16 -0
- package/dist/es/mz-92e1e39c.mjs +19 -0
- package/dist/es/na-3c30775f.mjs +18 -0
- package/dist/es/nc-c80aff50.mjs +18 -0
- package/dist/es/ne-b38208ab.mjs +11 -0
- package/dist/es/new-document-cfa14b7f.mjs +5 -0
- package/dist/es/nf-780a37dd.mjs +9 -0
- package/dist/es/ng-f5ea4118.mjs +19 -0
- package/dist/es/ni-60b41460.mjs +16 -0
- package/dist/es/nl-975a8624.mjs +11 -0
- package/dist/es/no-952bf512.mjs +19 -0
- package/dist/es/np-5135aa90.mjs +16 -0
- package/dist/es/nr-cecf1f05.mjs +9 -0
- package/dist/es/nu-c1ad2dc9.mjs +28 -0
- package/dist/es/nz-70a6e29f.mjs +21 -0
- package/dist/es/om-e5c99d1e.mjs +20 -0
- package/dist/es/owners-a58a9f25.mjs +5 -0
- package/dist/es/pa-0e401aff.mjs +16 -0
- package/dist/es/payout-575951ec.mjs +5 -0
- package/dist/es/pci-f4b6e5f5.mjs +5 -0
- package/dist/es/pe-823d3b3f.mjs +15 -0
- package/dist/es/pf-5c60fe59.mjs +24 -0
- package/dist/es/pg-71e8aaec.mjs +17 -0
- package/dist/es/ph-52f55ac4.mjs +16 -0
- package/dist/es/pk-372b07db.mjs +15 -0
- package/dist/es/pl-2c472f58.mjs +12 -0
- package/dist/es/plus-25579839.mjs +8 -0
- package/dist/es/pm-2195603b.mjs +38 -0
- package/dist/es/pn-ec73a623.mjs +25 -0
- package/dist/es/pr-8f159ad6.mjs +30 -0
- package/dist/es/ps-34dd64b7.mjs +11 -0
- package/dist/es/pt-b210cd4c.mjs +12 -0
- package/dist/es/pw-a474545d.mjs +15 -0
- package/dist/es/py-e271f15f.mjs +17 -0
- package/dist/es/qa-a7ad70ed.mjs +16 -0
- package/dist/es/re-a1440f32.mjs +10 -0
- package/dist/es/remove-6a123f82.mjs +5 -0
- package/dist/es/review-14953b30.mjs +8 -0
- package/dist/es/ro-8a071708.mjs +16 -0
- package/dist/es/rs-f3ea0f97.mjs +20 -0
- package/dist/es/ru-edd59839.mjs +19 -0
- package/dist/es/rw-df210dff.mjs +24 -0
- package/dist/es/sa-18c28dc4.mjs +9 -0
- package/dist/es/sb-35c0ab8d.mjs +36 -0
- package/dist/es/sc-82eb7101.mjs +22 -0
- package/dist/es/sd-dc5fb244.mjs +16 -0
- package/dist/es/se-0413b6f1.mjs +9 -0
- package/dist/es/search-3edfe795.mjs +5 -0
- package/dist/es/sg-8ff78597.mjs +15 -0
- package/dist/es/sh-7b636341.mjs +36 -0
- package/dist/es/si-2c09bba0.mjs +23 -0
- package/dist/es/signatory-c8417fb2.mjs +10 -0
- package/dist/es/sj-8aff2627.mjs +10 -0
- package/dist/es/sk-8da1fee7.mjs +23 -0
- package/dist/es/sl-92cb9116.mjs +15 -0
- package/dist/es/sm-6fd64a6a.mjs +16 -0
- package/dist/es/sn-57e8c34b.mjs +17 -0
- package/dist/es/so-f2f0ac03.mjs +15 -0
- package/dist/es/sr-7869b748.mjs +16 -0
- package/dist/es/ss-8e9c79ca.mjs +16 -0
- package/dist/es/st-6b3e911c.mjs +17 -0
- package/dist/es/store-9fc075e6.mjs +5 -0
- package/dist/es/sv-922ba5ea.mjs +14 -0
- package/dist/es/sx-c078bfd1.mjs +17 -0
- package/dist/es/sy-995ec1ee.mjs +16 -0
- package/dist/es/sz-da33c6e8.mjs +25 -0
- package/dist/es/tc-1a465526.mjs +27 -0
- package/dist/es/td-a7ff3830.mjs +10 -0
- package/dist/es/tf-c71eed4a.mjs +12 -0
- package/dist/es/tg-613f7f5a.mjs +17 -0
- package/dist/es/th-f517ca34.mjs +15 -0
- package/dist/es/tj-b99ac64f.mjs +16 -0
- package/dist/es/tk-c0dfeac1.mjs +10 -0
- package/dist/es/tl-35cc3595.mjs +17 -0
- package/dist/es/tm-0deecc32.mjs +47 -0
- package/dist/es/tn-190a49a0.mjs +15 -0
- package/dist/es/to-790cac18.mjs +19 -0
- package/dist/es/tr-1db5a437.mjs +16 -0
- package/dist/es/trust-0e40337d.mjs +5 -0
- package/dist/es/tt-85ae901c.mjs +16 -0
- package/dist/es/tv-9f2b4198.mjs +17 -0
- package/dist/es/tw-74aa27b3.mjs +16 -0
- package/dist/es/tz-2a5cf5e6.mjs +17 -0
- package/dist/es/ua-9fedceaa.mjs +9 -0
- package/dist/es/ug-1a8fee80.mjs +20 -0
- package/dist/es/um-d774b142.mjs +30 -0
- package/dist/es/us-20ac3d88.mjs +24 -0
- package/dist/es/uy-c22e1eb1.mjs +10 -0
- package/dist/es/uz-f8be4086.mjs +16 -0
- package/dist/es/va-d1f00296.mjs +12 -0
- package/dist/es/vc-0a06f1c2.mjs +17 -0
- package/dist/es/ve-3bc33c40.mjs +17 -0
- package/dist/es/vg-3ad787bf.mjs +31 -0
- package/dist/es/vi-5a78bf74.mjs +34 -0
- package/dist/es/vn-50e78ae2.mjs +9 -0
- package/dist/es/vu-72d9304c.mjs +37 -0
- package/dist/es/warning-bb000c6b.mjs +5 -0
- package/dist/es/wf-8cdbeff9.mjs +10 -0
- package/dist/es/wrong-652db543.mjs +5 -0
- package/dist/es/ws-745fc88c.mjs +16 -0
- package/dist/es/ye-f4eaca91.mjs +9 -0
- package/dist/es/yt-93635c9a.mjs +33 -0
- package/dist/es/za-42d70d0b.mjs +19 -0
- package/dist/es/zm-571a963f.mjs +24 -0
- package/dist/es/zw-6cf765c3.mjs +22 -0
- package/dist/es/zz-067ccc58.mjs +8 -0
- package/dist/style.css +40 -211
- package/dist/types/components/CompanyBasics/component/CompanyBasicsComponent.d.ts +1 -1
- package/dist/types/components/CompanyBasics/types.d.ts +1 -1
- package/dist/types/components/CompanyOtherDetails/component/CompanyOtherDetailsComponent.d.ts +1 -1
- package/dist/types/components/IdentityNumber/component/IdentityNumberComponent.d.ts +1 -3
- package/dist/types/components/IdentityNumber/fieldConfig.d.ts +12 -0
- package/dist/types/components/IdentityNumber/type.d.ts +6 -3
- package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityAu/component/DriversLicense.d.ts +4 -3
- package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityAu/component/IdentityAuComponent.d.ts +1 -1
- package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityHK/component/IdentityHKComponent.d.ts +1 -1
- package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityHK/validate.d.ts +0 -2
- package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityNZ/component/DriversLicense.d.ts +4 -3
- package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityNZ/component/IdentityNZComponent.d.ts +1 -1
- package/dist/types/components/PersonalDetails/component/IdentityComponent/TypeOfIdentity/index.d.ts +5 -5
- package/dist/types/components/PersonalDetails/component/IdentityComponent/types.d.ts +4 -6
- package/dist/types/components/PersonalDetails/types.d.ts +3 -2
- package/dist/types/components/TaskList/types.d.ts +2 -1
- package/dist/types/components/internal/AccordionItem/types.d.ts +2 -1
- package/dist/types/components/internal/Address/utils.d.ts +1 -1
- package/dist/types/components/internal/BankAccountFormat/BankAccountFormat.d.ts +1 -1
- package/dist/types/components/internal/BankAccountNumber/BankAccountNumber.d.ts +1 -1
- package/dist/types/components/internal/BankAccountNumber/fieldConfig.d.ts +5 -0
- package/dist/types/components/internal/BankAccountNumber/index.d.ts +1 -1
- package/dist/types/components/internal/BankAccountNumber/types.d.ts +2 -0
- package/dist/types/components/internal/BankCity/BankCity.d.ts +1 -1
- package/dist/types/components/internal/BankCity/index.d.ts +1 -1
- package/dist/types/components/internal/BankCode/BankCode.d.ts +1 -1
- package/dist/types/components/internal/BankCode/fieldConfig.d.ts +5 -0
- package/dist/types/components/internal/BankCode/index.d.ts +1 -1
- package/dist/types/components/internal/BankCode/types.d.ts +6 -1
- package/dist/types/components/internal/BankName/BankName.d.ts +1 -1
- package/dist/types/components/internal/BankName/index.d.ts +1 -1
- package/dist/types/components/internal/BranchCode/BranchCode.d.ts +1 -1
- package/dist/types/components/internal/BranchCode/fieldConfig.d.ts +5 -0
- package/dist/types/components/internal/BranchCode/index.d.ts +1 -1
- package/dist/types/components/internal/BranchCode/types.d.ts +6 -1
- package/dist/types/components/internal/Button/types.d.ts +2 -1
- package/dist/types/components/internal/CountryField/Flag.d.ts +7 -0
- package/dist/types/components/internal/FormFields/MaskedInputText/MaskedInputText.d.ts +2 -1
- package/dist/types/components/internal/FormFields/Select/types.d.ts +1 -2
- package/dist/types/components/internal/Iban/Iban.d.ts +1 -1
- package/dist/types/components/internal/Iban/fieldConfig.d.ts +5 -0
- package/dist/types/components/internal/Iban/ibanValidator.d.ts +1 -4
- package/dist/types/components/internal/Iban/index.d.ts +1 -1
- package/dist/types/components/internal/Iban/types.d.ts +2 -0
- package/dist/types/components/internal/Icon/Icon.d.ts +41 -3
- package/dist/types/components/internal/IdFieldTypeSelector/countryIdNumberTypes.d.ts +35 -2
- package/dist/types/components/internal/Link/types.d.ts +2 -1
- package/dist/types/components/internal/Menu/ActionsMenu.d.ts +2 -1
- package/dist/types/components/internal/Status/types.d.ts +2 -1
- package/dist/types/components/internal/SwiftCode/SwiftCode.d.ts +1 -1
- package/dist/types/components/internal/SwiftCode/fieldConfig.d.ts +3 -0
- package/dist/types/components/internal/SwiftCode/index.d.ts +1 -1
- package/dist/types/components/internal/TaxId/types.d.ts +0 -7
- package/dist/types/components/internal/TaxInformationField/fieldConfig.d.ts +249 -7
- package/dist/types/core/Context/ConfigurationApiContext/ConfigurationApiContext.d.ts +0 -1
- package/dist/types/core/Context/StateContext/useGlobalData.d.ts +1 -2
- package/dist/types/core/SDKValidation/index.d.ts +1 -1
- package/dist/types/core/Services/agnostic/get-images.d.ts +0 -1
- package/dist/types/core/Services/agnostic/index.d.ts +0 -1
- package/dist/types/core/core.d.ts +1 -1
- package/dist/types/core/hooks/useForm/reducer.d.ts +3 -3
- package/dist/types/core/hooks/useForm/types.d.ts +3 -3
- package/dist/types/core/hooks/useForm/useForm.d.ts +2 -2
- package/dist/types/core/hooks/useIsElementVisible.d.ts +2 -1
- package/dist/types/core/models/api/company-search.d.ts +2 -1
- package/dist/types/core/models/api/company-types-value.d.ts +3 -0
- package/dist/types/core/models/api/organization-type.d.ts +5 -0
- package/dist/types/core/models/api/organization.d.ts +3 -0
- package/dist/types/core/models/api/transfer-instrument.d.ts +1 -1
- package/dist/types/core/models/field-configurations.d.ts +1 -0
- package/dist/types/core/models/payout-account.d.ts +1 -1
- package/dist/types/core/models/scenario-fields.d.ts +1 -1
- package/dist/types/core/process-field-configurations.d.ts +1 -1
- package/dist/types/language/config.d.ts +8 -3
- package/dist/types/utils/dynamicImports.d.ts +3 -0
- package/dist/types/utils/entity-status-util.d.ts +1 -1
- package/dist/types/utils/formUtils.d.ts +1 -0
- package/dist/types/utils/isValueObscured.d.ts +1 -0
- package/dist/types/utils/mapping/companySearch/index.d.ts +1 -1
- package/dist/types/utils/mapping/companySearch/mapOrganizationTypeToCompanyType.d.ts +9 -0
- package/dist/types/utils/mapping/componentApiMapping.d.ts +1 -1
- package/dist/types/utils/masking/maskHelpers.d.ts +1 -0
- package/dist/types/utils/masking/matchAgainstMask.d.ts +3 -2
- package/dist/types/utils/omitObscuredFieldsIfUnchanged.d.ts +2 -0
- package/dist/types/utils/regex/countryIdNumberPatterns.d.ts +9 -6
- package/dist/types/utils/regex/driversLicenseCardNumberPatterns.d.ts +1 -0
- package/dist/types/utils/regex/proofOfIdentityCardPatterns.d.ts +0 -1
- package/dist/types/utils/validatorUtils.d.ts +11 -26
- package/package.json +3 -2
- package/dist/types/components/IdentityNumber/formats.d.ts +0 -18
- package/dist/types/components/IdentityNumber/validate.d.ts +0 -41
- package/dist/types/components/IdentityNumber/validate.helper.d.ts +0 -3
- package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityAu/component/PassportNumber.d.ts +0 -15
- package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityHK/component/DriversLicense.d.ts +0 -14
- package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityHK/component/PassportNumber.d.ts +0 -9
- package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityHK/component/ProofOfIdentityCard.d.ts +0 -10
- package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityNZ/component/PassportNumber.d.ts +0 -15
- package/dist/types/components/PersonalDetails/component/IdentityComponent/TypeOfIdentity/types.d.ts +0 -9
- package/dist/types/components/PersonalDetails/component/labels.d.ts +0 -4
- package/dist/types/core/Services/agnostic/get-fonts.d.ts +0 -9
- package/dist/types/utils/formatting/stripCountryIdFormat.d.ts +0 -2
- package/dist/types/utils/formatting/stripNonAlphanumeric.d.ts +0 -1
- package/dist/types/utils/isValueMasked.d.ts +0 -1
- package/dist/types/utils/mapping/companySearch/mapKompanyOrganizationTypeToCompanyType.d.ts +0 -2
- package/dist/types/utils/omitMaskedFieldsIfUnchanged.d.ts +0 -2
|
@@ -2,8 +2,8 @@ import { useContext, useState, useCallback, useEffect, useMemo, useReducer, useR
|
|
|
2
2
|
import { createContext, createElement, render } from "preact";
|
|
3
3
|
import { sanitize } from "isomorphic-dompurify";
|
|
4
4
|
import cx from "classnames";
|
|
5
|
+
import { lazy, Suspense, useId, forwardRef, memo, useMemo as useMemo$1, useEffect as useEffect$1, useState as useState$1, useCallback as useCallback$1 } from "preact/compat";
|
|
5
6
|
import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
|
|
6
|
-
import { useId, forwardRef, memo, useMemo as useMemo$1, useEffect as useEffect$1, useState as useState$1, useCallback as useCallback$1 } from "preact/compat";
|
|
7
7
|
import { debounce, noop as noop$1, isEmpty as isEmpty$1, range } from "lodash";
|
|
8
8
|
import OpenBankingSDK from "@adyen/openbankingsdk";
|
|
9
9
|
import "@adyen/adyen-document-viewer/dist/adyen-document-viewer.min.css";
|
|
@@ -65,7 +65,7 @@ const contactDetails = "Contact Details";
|
|
|
65
65
|
const uploadDocument = "Upload Document";
|
|
66
66
|
const individualDetails = "Individual details";
|
|
67
67
|
const last4DigitsOfSocialSecurityNumber = "Last 4 digits of Social Security Number (SSN)";
|
|
68
|
-
const
|
|
68
|
+
const socialSecurityNumber = "Social Security Number (SSN)";
|
|
69
69
|
const socialInsuranceNumber = "Social Insurance Number (SIN)";
|
|
70
70
|
const codiceFiscale = "Codice fiscale";
|
|
71
71
|
const personnummer = "Personnummer";
|
|
@@ -74,7 +74,7 @@ const nie = "NIE";
|
|
|
74
74
|
const peselNumber = "PESEL number";
|
|
75
75
|
const detCentralePersonregister = "Det Centrale Personregister (CPR)";
|
|
76
76
|
const codNumericPersonal = "Cod Numeric Personal (CNP)";
|
|
77
|
-
const cadastroDePessoasFisicas = "Cadastro de Pessoas Físicas (
|
|
77
|
+
const cadastroDePessoasFisicas = "Cadastro de Pessoas Físicas (CPF)";
|
|
78
78
|
const invalidFormatExpects = "Invalid format. Expected format: %{format}";
|
|
79
79
|
const invalidFormatForAuPassportNumber = "This isn't a valid Australian passport number. Expected format: 1-2 letters followed by 7 numbers.";
|
|
80
80
|
const invalidFormatForNZPassportNumber = "Expected format should be 8-9 alphanumeric characters. For example: PA094043.";
|
|
@@ -302,6 +302,7 @@ const bankAccountNumber = "Account number";
|
|
|
302
302
|
const iban = "IBAN";
|
|
303
303
|
const swiftCode = "Swift code";
|
|
304
304
|
const bic = "BIC";
|
|
305
|
+
const bicSwift = "BIC / SWIFT";
|
|
305
306
|
const bsbNumber = "BSB Number";
|
|
306
307
|
const branchCode = "Branch code";
|
|
307
308
|
const transitNumber = "Transit number";
|
|
@@ -347,8 +348,7 @@ const confirm = "Confirm";
|
|
|
347
348
|
const goToDecisionMakers = "Go to list of decision-makers";
|
|
348
349
|
const theSubmitWasSuccessful = "The submit was successful";
|
|
349
350
|
const thereWasAnErrorTryAgain = "There was an error, please try again";
|
|
350
|
-
const
|
|
351
|
-
const proofOfIdentityCardNumber = "Identity card number";
|
|
351
|
+
const stateIssuedProofOfIdentityCard = "State-issued proof of identity card";
|
|
352
352
|
const proofOfResidence = "Proof of residency";
|
|
353
353
|
const proofOfNationalId = "Proof of national ID";
|
|
354
354
|
const backToTaskList = "Back to task list";
|
|
@@ -706,13 +706,17 @@ const liRegistrationNumber = "Unternehmensnummer";
|
|
|
706
706
|
const Mehrwertsteuernummer = "Mehrwertsteuernummer (MwST), Numéro de TVA, Numero dell’imposta sul valore aggiunto (IVA), VAT number";
|
|
707
707
|
const enterNDigitsForExample = "Enter %{numDigits} digits. For example, %{example}";
|
|
708
708
|
const enterNCharactersForExample = "Enter %{numChars} characters. For example, %{example}";
|
|
709
|
+
const enterLastNDigitsForExample = "Enter the last %{numDigits} digits. For example, %{example}";
|
|
709
710
|
const enterXToYDigitsForExample = "Enter %{minDigits} to %{maxDigits} digits. For example, %{example}";
|
|
711
|
+
const enterXOrYDigitsForExample = "Enter %{xDigits} or %{yDigits} digits. For example, %{example}";
|
|
710
712
|
const enterXToYCharactersForExample = "Enter %{minChars} to %{maxChars} characters. For example, %{example}";
|
|
713
|
+
const enterXOrYCharactersForExample = "Enter %{xChars} or %{yChars} characters. For example, %{example}";
|
|
711
714
|
const enterXToYCharactersWithAMixForExample = "Enter %{minChars} to %{maxChars} characters, with a mix of letters and numbers. For example, %{example}";
|
|
712
715
|
const enterAMaximumOfNDigitsForExample = "Enter a maximum of %{maxDigits} digits. For example, %{example}";
|
|
713
716
|
const enterAMaximumOfNMoreDigitsForExample = "Enter a maximum of %{maxDigits} more digits. For example, %{example}";
|
|
714
717
|
const enterAMaximumOfNCharactersForExample = "Enter a maximum of %{maxChars} characters. For example, %{example}";
|
|
715
718
|
const enterAMaximumOfNCharactersWithAMixForExample = "Enter a maximum of %{maxChars} characters, with a mix of letters and numbers. For example, %{example}";
|
|
719
|
+
const enterNCharactersWithAMixForExample = "Enter %{numChars} characters, with a mix of letters and numbers. For example, %{example}";
|
|
716
720
|
const enterNDigitsAndThen1LetterForExample = "Enter %{numDigits} digits and then 1 letter. For example, %{example}";
|
|
717
721
|
const enter1LetterAndThenNDigitsForExample = "Enter 1 letter and then %{numDigits} digits. For example, %{example}";
|
|
718
722
|
const enter1LetterAndThenXToYDigitsForExample = "Enter 1 letter and then %{minDigits} to %{maxDigits} digits. For example, %{example}";
|
|
@@ -1211,6 +1215,7 @@ const introductionScreenAccountDescriptionP2 = "This is the bank account you use
|
|
|
1211
1215
|
const introductionScreenEpilogueTitle = "Why do we need this information?";
|
|
1212
1216
|
const introductionScreenEpilogueDescriptionP1 = "We check all this information against official records to verify your identity and comply with financial regulations.";
|
|
1213
1217
|
const introductionScreenEpilogueDescriptionP2 = "Your information will be used only for these purposes.";
|
|
1218
|
+
const oib = "OIB";
|
|
1214
1219
|
const addBankDetails = "Add bank details";
|
|
1215
1220
|
const addMissingBankDetails = "We are missing your bank details in order to perform payouts, please add your bank account.";
|
|
1216
1221
|
const bankDetails = "Bank details";
|
|
@@ -1274,7 +1279,7 @@ const defaultTrans = {
|
|
|
1274
1279
|
uploadDocument,
|
|
1275
1280
|
individualDetails,
|
|
1276
1281
|
last4DigitsOfSocialSecurityNumber,
|
|
1277
|
-
|
|
1282
|
+
socialSecurityNumber,
|
|
1278
1283
|
socialInsuranceNumber,
|
|
1279
1284
|
codiceFiscale,
|
|
1280
1285
|
personnummer,
|
|
@@ -1511,6 +1516,7 @@ const defaultTrans = {
|
|
|
1511
1516
|
iban,
|
|
1512
1517
|
swiftCode,
|
|
1513
1518
|
bic,
|
|
1519
|
+
bicSwift,
|
|
1514
1520
|
bsbNumber,
|
|
1515
1521
|
branchCode,
|
|
1516
1522
|
transitNumber,
|
|
@@ -1556,8 +1562,7 @@ const defaultTrans = {
|
|
|
1556
1562
|
goToDecisionMakers,
|
|
1557
1563
|
theSubmitWasSuccessful,
|
|
1558
1564
|
thereWasAnErrorTryAgain,
|
|
1559
|
-
|
|
1560
|
-
proofOfIdentityCardNumber,
|
|
1565
|
+
stateIssuedProofOfIdentityCard,
|
|
1561
1566
|
proofOfResidence,
|
|
1562
1567
|
proofOfNationalId,
|
|
1563
1568
|
backToTaskList,
|
|
@@ -1922,13 +1927,17 @@ const defaultTrans = {
|
|
|
1922
1927
|
Mehrwertsteuernummer,
|
|
1923
1928
|
enterNDigitsForExample,
|
|
1924
1929
|
enterNCharactersForExample,
|
|
1930
|
+
enterLastNDigitsForExample,
|
|
1925
1931
|
enterXToYDigitsForExample,
|
|
1932
|
+
enterXOrYDigitsForExample,
|
|
1926
1933
|
enterXToYCharactersForExample,
|
|
1934
|
+
enterXOrYCharactersForExample,
|
|
1927
1935
|
enterXToYCharactersWithAMixForExample,
|
|
1928
1936
|
enterAMaximumOfNDigitsForExample,
|
|
1929
1937
|
enterAMaximumOfNMoreDigitsForExample,
|
|
1930
1938
|
enterAMaximumOfNCharactersForExample,
|
|
1931
1939
|
enterAMaximumOfNCharactersWithAMixForExample,
|
|
1940
|
+
enterNCharactersWithAMixForExample,
|
|
1932
1941
|
enterNDigitsAndThen1LetterForExample,
|
|
1933
1942
|
enter1LetterAndThenNDigitsForExample,
|
|
1934
1943
|
enter1LetterAndThenXToYDigitsForExample,
|
|
@@ -2428,6 +2437,7 @@ const defaultTrans = {
|
|
|
2428
2437
|
introductionScreenEpilogueTitle,
|
|
2429
2438
|
introductionScreenEpilogueDescriptionP1,
|
|
2430
2439
|
introductionScreenEpilogueDescriptionP2,
|
|
2440
|
+
oib,
|
|
2431
2441
|
addBankDetails,
|
|
2432
2442
|
addMissingBankDetails,
|
|
2433
2443
|
bankDetails,
|
|
@@ -2750,6 +2760,7 @@ const formUtilities = (props, i18n) => ({
|
|
|
2750
2760
|
return this.isRequiredField(field, showIfNotInRequiredFields) || this.isOptionalField(field);
|
|
2751
2761
|
},
|
|
2752
2762
|
isReadOnly: (field) => props.readOnly || (props.readOnlyFields ? props.readOnlyFields.includes(field) : false),
|
|
2763
|
+
isObscured: (field) => props.obscuredFields ? props.obscuredFields.includes(field) : false,
|
|
2753
2764
|
getVal: (val) => i18n.get(val),
|
|
2754
2765
|
getErrorMessage: (field, errors, fieldProblems) => {
|
|
2755
2766
|
var _a;
|
|
@@ -2849,10 +2860,6 @@ const mergeFieldMetadataIntoProps = (fieldName, metadata, otherProps) => {
|
|
|
2849
2860
|
};
|
|
2850
2861
|
};
|
|
2851
2862
|
const MAX_LENGTH = 30;
|
|
2852
|
-
const getMaxLengthByFormatRuleset = (formattingRules, field) => {
|
|
2853
|
-
var _a;
|
|
2854
|
-
return ((_a = formattingRules[field]) == null ? void 0 : _a.maxlength) || MAX_LENGTH;
|
|
2855
|
-
};
|
|
2856
2863
|
const getMaxLengthByFieldAndCountry = (formattingRules, field, country2, ignoreIfFormatterExists) => {
|
|
2857
2864
|
var _a, _b, _c, _d;
|
|
2858
2865
|
if (ignoreIfFormatterExists && ((_b = (_a = formattingRules[country2]) == null ? void 0 : _a[field]) == null ? void 0 : _b.formatter)) {
|
|
@@ -2861,75 +2868,18 @@ const getMaxLengthByFieldAndCountry = (formattingRules, field, country2, ignoreI
|
|
|
2861
2868
|
const maxLength = (_d = (_c = formattingRules[country2]) == null ? void 0 : _c[field]) == null ? void 0 : _d.maxlength;
|
|
2862
2869
|
return maxLength || MAX_LENGTH;
|
|
2863
2870
|
};
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
}
|
|
2868
|
-
const mergedValidators = {};
|
|
2869
|
-
Object.entries(defaultValidatorsObj).forEach(([field, validatorsByField]) => {
|
|
2870
|
-
const countryBasedFieldValidators = countryBasedValidators[country2][field];
|
|
2871
|
-
if (!countryBasedFieldValidators) {
|
|
2872
|
-
mergedValidators[field] = validatorsByField;
|
|
2873
|
-
} else {
|
|
2874
|
-
const defaultFieldValidatorsArray = !Array.isArray(validatorsByField) ? [validatorsByField] : [...validatorsByField];
|
|
2875
|
-
const countryFieldValidatorsArray = !Array.isArray(countryBasedFieldValidators) ? [countryBasedFieldValidators] : [...countryBasedFieldValidators];
|
|
2876
|
-
mergedValidators[field] = [...countryFieldValidatorsArray];
|
|
2877
|
-
defaultFieldValidatorsArray.forEach((rule) => {
|
|
2878
|
-
const defaultModesArr = rule.modes;
|
|
2879
|
-
let modeArraysMatch = false;
|
|
2880
|
-
countryFieldValidatorsArray.every((item) => {
|
|
2881
|
-
modeArraysMatch = doArraysMatch(item.modes, defaultModesArr);
|
|
2882
|
-
return !modeArraysMatch;
|
|
2883
|
-
});
|
|
2884
|
-
if (!modeArraysMatch) {
|
|
2885
|
-
mergedValidators[field].unshift(rule);
|
|
2886
|
-
}
|
|
2887
|
-
});
|
|
2888
|
-
}
|
|
2889
|
-
});
|
|
2890
|
-
Object.entries(countryBasedValidators[country2]).forEach(([field, validators]) => {
|
|
2891
|
-
if (!mergedValidators[field]) {
|
|
2892
|
-
mergedValidators[field] = validators;
|
|
2893
|
-
}
|
|
2894
|
-
});
|
|
2895
|
-
return mergedValidators;
|
|
2896
|
-
}
|
|
2897
|
-
function mergeCountryBasedRulesets(defaultRuleset, countryBasedRuleset, country2) {
|
|
2898
|
-
if (!country2 || !countryBasedRuleset[country2]) {
|
|
2899
|
-
return defaultRuleset;
|
|
2900
|
-
}
|
|
2901
|
-
const mergedRuleset = {};
|
|
2902
|
-
Object.entries(defaultRuleset).forEach(([field, ruleset]) => {
|
|
2903
|
-
const countryBasedFieldRuleset = countryBasedRuleset[country2][field];
|
|
2904
|
-
if (!countryBasedFieldRuleset) {
|
|
2905
|
-
mergedRuleset[field] = ruleset;
|
|
2906
|
-
} else {
|
|
2907
|
-
mergedRuleset[field] = {
|
|
2908
|
-
...ruleset,
|
|
2909
|
-
...countryBasedFieldRuleset
|
|
2910
|
-
};
|
|
2911
|
-
}
|
|
2912
|
-
});
|
|
2913
|
-
Object.entries(countryBasedRuleset[country2]).forEach(([field, ruleset]) => {
|
|
2914
|
-
if (!mergedRuleset[field]) {
|
|
2915
|
-
mergedRuleset[field] = ruleset;
|
|
2916
|
-
}
|
|
2917
|
-
});
|
|
2918
|
-
return mergedRuleset;
|
|
2919
|
-
}
|
|
2920
|
-
const isUndefinedOrNull = (input) => !!(input === void 0 || input === null);
|
|
2921
|
-
const isEmpty = (input) => !!(isUndefinedOrNull(input) || typeof input === "object" && Object.keys(input).length === 0 || typeof input === "string" && /^[\s]*$/.test(input));
|
|
2922
|
-
const hasEmptyFields = (input) => input && (Object.keys(input).length === 0 || Object.values(input).some((value) => value === void 0 || value === null || value === ""));
|
|
2871
|
+
const isUndefinedOrNull = (input) => input === void 0 || input === null;
|
|
2872
|
+
const isEmpty = (input) => isUndefinedOrNull(input) || typeof input === "object" && Object.keys(input).length === 0 || typeof input === "string" && /^\s*$/.test(input);
|
|
2873
|
+
const hasEmptyFields = (input) => input !== void 0 && (Object.keys(input).length === 0 || Object.values(input).some((value) => value === void 0 || value === null || value === ""));
|
|
2923
2874
|
const isAccountNumberMasked = (payload) => {
|
|
2924
2875
|
var _a;
|
|
2925
|
-
return (payload == null ? void 0 : payload.accountNumber) && ((_a = payload == null ? void 0 : payload.accountNumber) == null ? void 0 : _a.includes("*"));
|
|
2876
|
+
return Boolean(payload == null ? void 0 : payload.accountNumber) && ((_a = payload == null ? void 0 : payload.accountNumber) == null ? void 0 : _a.includes("*"));
|
|
2926
2877
|
};
|
|
2927
2878
|
const extractFieldName = (inputString) => {
|
|
2928
2879
|
const fieldNames = inputString == null ? void 0 : inputString.split(".");
|
|
2929
2880
|
const fieldName = (fieldNames == null ? void 0 : fieldNames.length) > 0 ? fieldNames[fieldNames.length - 1] : "";
|
|
2930
2881
|
return fieldName;
|
|
2931
2882
|
};
|
|
2932
|
-
const mapKeyToFieldName = (i18n, key) => i18n == null ? void 0 : i18n.get(key);
|
|
2933
2883
|
const concatenateFieldNames = (fieldNames) => fieldNames == null ? void 0 : fieldNames.join(", ");
|
|
2934
2884
|
const isString = (input) => typeof input === "string" || input instanceof String;
|
|
2935
2885
|
const hasText = (input) => isString(input) && !isEmpty(input);
|
|
@@ -2941,21 +2891,90 @@ const exactLength = (input, length) => {
|
|
|
2941
2891
|
}
|
|
2942
2892
|
return input.length === length;
|
|
2943
2893
|
};
|
|
2944
|
-
const lengthIsBetween = (input, minLength, maxLength) => (input
|
|
2894
|
+
const lengthIsBetween = (input, minLength, maxLength) => Boolean(input && input.length >= minLength && input.length <= maxLength);
|
|
2945
2895
|
const trimValWithOneSpace = (val) => val.trimStart().replace(/\s+/g, " ");
|
|
2946
2896
|
const _button_component = "";
|
|
2947
2897
|
const _link_component = "";
|
|
2948
|
-
const
|
|
2898
|
+
const Icon$1 = "";
|
|
2899
|
+
let suppressed = false;
|
|
2900
|
+
const consoleMethodsPrefixable = Object.freeze(["debug", "info", "log", "warn", "error", "trace"]);
|
|
2901
|
+
const stringSubstitutionRegex = /%([soOc]|(\.\d)?[dif])/;
|
|
2902
|
+
const createLogger = (namespace) => {
|
|
2903
|
+
const methods = {};
|
|
2904
|
+
consoleMethodsPrefixable.forEach((method) => {
|
|
2905
|
+
methods[method] = (arg1, ...args) => {
|
|
2906
|
+
if (!console[method] || suppressed)
|
|
2907
|
+
return;
|
|
2908
|
+
if (!namespace) {
|
|
2909
|
+
console[method](arg1, ...args);
|
|
2910
|
+
} else if (stringSubstitutionRegex.test(arg1)) {
|
|
2911
|
+
console[method](`[${namespace}] ${arg1}`, ...args);
|
|
2912
|
+
} else {
|
|
2913
|
+
console[method](`[${namespace}]`, arg1, ...args);
|
|
2914
|
+
}
|
|
2915
|
+
};
|
|
2916
|
+
});
|
|
2917
|
+
return methods;
|
|
2918
|
+
};
|
|
2919
|
+
const icons = {
|
|
2920
|
+
"arrow-left": lazy(() => import("./arrow-left-3d6cd330.mjs")),
|
|
2921
|
+
"arrow-right": lazy(() => import("./arrow-right-994e40f8.mjs")),
|
|
2922
|
+
bin: lazy(() => import("./bin-191739de.mjs")),
|
|
2923
|
+
check: lazy(() => import("./check-b5a70376.mjs")),
|
|
2924
|
+
checkmark: lazy(() => import("./checkmark-fd78da6f.mjs")),
|
|
2925
|
+
"checkmark-small": lazy(() => import("./checkmark-small-bf41309f.mjs")),
|
|
2926
|
+
"chevron-down": lazy(() => import("./chevron-down-df0a3ac6.mjs")),
|
|
2927
|
+
"chevron-right": lazy(() => import("./chevron-right-23ff6e47.mjs")),
|
|
2928
|
+
"chevron-up": lazy(() => import("./chevron-up-abfe0e90.mjs")),
|
|
2929
|
+
company: lazy(() => import("./company-4f71e406.mjs")),
|
|
2930
|
+
contract: lazy(() => import("./contract-5bc99018.mjs")),
|
|
2931
|
+
"controlling-person": lazy(() => import("./controlling-person-88da578f.mjs")),
|
|
2932
|
+
cross: lazy(() => import("./cross-c2431982.mjs")),
|
|
2933
|
+
"decision-maker": lazy(() => import("./decision-maker-a2182544.mjs")),
|
|
2934
|
+
document: lazy(() => import("./document-88abec41.mjs")),
|
|
2935
|
+
download: lazy(() => import("./download-54b1a163.mjs")),
|
|
2936
|
+
edit: lazy(() => import("./edit-e3629680.mjs")),
|
|
2937
|
+
"field-error": lazy(() => import("./field-error-620e1903.mjs")),
|
|
2938
|
+
"info-circle": lazy(() => import("./info-circle-3d2e7ba8.mjs")),
|
|
2939
|
+
"light-bulb": lazy(() => import("./light-bulb-d403fe24.mjs")),
|
|
2940
|
+
location: lazy(() => import("./location-e7c2a8f5.mjs")),
|
|
2941
|
+
"more-horiz": lazy(() => import("./more-horiz-0ca4ec23.mjs")),
|
|
2942
|
+
"new-document": lazy(() => import("./new-document-cfa14b7f.mjs")),
|
|
2943
|
+
owners: lazy(() => import("./owners-a58a9f25.mjs")),
|
|
2944
|
+
payout: lazy(() => import("./payout-575951ec.mjs")),
|
|
2945
|
+
pci: lazy(() => import("./pci-f4b6e5f5.mjs")),
|
|
2946
|
+
plus: lazy(() => import("./plus-25579839.mjs")),
|
|
2947
|
+
remove: lazy(() => import("./remove-6a123f82.mjs")),
|
|
2948
|
+
review: lazy(() => import("./review-14953b30.mjs")),
|
|
2949
|
+
search: lazy(() => import("./search-3edfe795.mjs")),
|
|
2950
|
+
signatory: lazy(() => import("./signatory-c8417fb2.mjs")),
|
|
2951
|
+
store: lazy(() => import("./store-9fc075e6.mjs")),
|
|
2952
|
+
trust: lazy(() => import("./trust-0e40337d.mjs")),
|
|
2953
|
+
warning: lazy(() => import("./warning-bb000c6b.mjs")),
|
|
2954
|
+
wrong: lazy(() => import("./wrong-652db543.mjs"))
|
|
2955
|
+
};
|
|
2956
|
+
const logger$v = createLogger("Icon");
|
|
2949
2957
|
const Icon = ({
|
|
2950
|
-
className
|
|
2958
|
+
className,
|
|
2951
2959
|
name,
|
|
2952
2960
|
testId
|
|
2953
|
-
}) =>
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
}
|
|
2961
|
+
}) => {
|
|
2962
|
+
const LazyLoadedIcon = icons[name];
|
|
2963
|
+
if (!LazyLoadedIcon) {
|
|
2964
|
+
logger$v.error(`No such icon: "${name}"`);
|
|
2965
|
+
return null;
|
|
2966
|
+
}
|
|
2967
|
+
return jsx("span", {
|
|
2968
|
+
className: cx("adyen-kyc-icon", `adyen-kyc-icon-${name}`, className),
|
|
2969
|
+
role: "img",
|
|
2970
|
+
"aria-hidden": true,
|
|
2971
|
+
"data-testid": testId,
|
|
2972
|
+
children: jsx(Suspense, {
|
|
2973
|
+
fallback: null,
|
|
2974
|
+
children: jsx(LazyLoadedIcon, {})
|
|
2975
|
+
})
|
|
2976
|
+
});
|
|
2977
|
+
};
|
|
2959
2978
|
const Spinner$1 = "";
|
|
2960
2979
|
const Spinner = ({
|
|
2961
2980
|
inline = false,
|
|
@@ -3149,26 +3168,6 @@ function useFormRouterContext() {
|
|
|
3149
3168
|
}
|
|
3150
3169
|
return context;
|
|
3151
3170
|
}
|
|
3152
|
-
let suppressed = false;
|
|
3153
|
-
const consoleMethodsPrefixable = Object.freeze(["debug", "info", "log", "warn", "error", "trace"]);
|
|
3154
|
-
const stringSubstitutionRegex = /%([soOc]|(\.\d)?[dif])/;
|
|
3155
|
-
const createLogger = (namespace) => {
|
|
3156
|
-
const methods = {};
|
|
3157
|
-
consoleMethodsPrefixable.forEach((method) => {
|
|
3158
|
-
methods[method] = (arg1, ...args) => {
|
|
3159
|
-
if (!console[method] || suppressed)
|
|
3160
|
-
return;
|
|
3161
|
-
if (!namespace) {
|
|
3162
|
-
console[method](arg1, ...args);
|
|
3163
|
-
} else if (stringSubstitutionRegex.test(arg1)) {
|
|
3164
|
-
console[method](`[${namespace}] ${arg1}`, ...args);
|
|
3165
|
-
} else {
|
|
3166
|
-
console[method](`[${namespace}]`, arg1, ...args);
|
|
3167
|
-
}
|
|
3168
|
-
};
|
|
3169
|
-
});
|
|
3170
|
-
return methods;
|
|
3171
|
-
};
|
|
3172
3171
|
const logger$u = createLogger("Link");
|
|
3173
3172
|
const getIconClass = (icon, external) => {
|
|
3174
3173
|
if (external) {
|
|
@@ -3342,7 +3341,7 @@ function getFormProps(props, innerFormId) {
|
|
|
3342
3341
|
readOnlyFields: ((_g = props.readOnlyFields) == null ? void 0 : _g[innerFormId]) ?? [],
|
|
3343
3342
|
requiredFields: ((_h = props.requiredFields) == null ? void 0 : _h[innerFormId]) ?? [],
|
|
3344
3343
|
optionalFields: ((_i = props.optionalFields) == null ? void 0 : _i[innerFormId]) ?? [],
|
|
3345
|
-
|
|
3344
|
+
obscuredFields: ((_j = props.obscuredFields) == null ? void 0 : _j[innerFormId]) ?? [],
|
|
3346
3345
|
verifyFields: ((_k = props.verifyFields) == null ? void 0 : _k[innerFormId]) ?? [],
|
|
3347
3346
|
formVerificationErrors: ((_m = (_l = props.problems) == null ? void 0 : _l.verificationErrors) == null ? void 0 : _m[innerFormId]) ?? {},
|
|
3348
3347
|
fieldValidationErrors: ((_o = (_n = props.problems) == null ? void 0 : _n.validationErrors) == null ? void 0 : _o[innerFormId]) ?? {},
|
|
@@ -3369,7 +3368,7 @@ function getFieldProps(props, innerFormFields) {
|
|
|
3369
3368
|
masks: {},
|
|
3370
3369
|
data: {},
|
|
3371
3370
|
requiredFields: [],
|
|
3372
|
-
|
|
3371
|
+
obscuredFields: [],
|
|
3373
3372
|
optionalFields: [],
|
|
3374
3373
|
readOnlyFields: [],
|
|
3375
3374
|
verifyFields: [],
|
|
@@ -3397,8 +3396,8 @@ function getFieldProps(props, innerFormFields) {
|
|
|
3397
3396
|
if ((_j = props.fieldValidationErrors) == null ? void 0 : _j[field]) {
|
|
3398
3397
|
nestedFormProps.fieldValidationErrors[field] = props.fieldValidationErrors[field];
|
|
3399
3398
|
}
|
|
3400
|
-
if ((_k = props.
|
|
3401
|
-
nestedFormProps.
|
|
3399
|
+
if ((_k = props.obscuredFields) == null ? void 0 : _k.includes(field)) {
|
|
3400
|
+
nestedFormProps.obscuredFields.push(field);
|
|
3402
3401
|
}
|
|
3403
3402
|
if ((_l = props.validators) == null ? void 0 : _l[field]) {
|
|
3404
3403
|
if (!(nestedFormProps == null ? void 0 : nestedFormProps.validators)) {
|
|
@@ -3476,7 +3475,7 @@ const processField = ({
|
|
|
3476
3475
|
value = null,
|
|
3477
3476
|
mode,
|
|
3478
3477
|
defaultData,
|
|
3479
|
-
|
|
3478
|
+
obscuredFields,
|
|
3480
3479
|
fieldContext,
|
|
3481
3480
|
formatters,
|
|
3482
3481
|
staticValidate,
|
|
@@ -3485,7 +3484,7 @@ const processField = ({
|
|
|
3485
3484
|
var _a, _b;
|
|
3486
3485
|
const formatterFn = ((_a = formatters == null ? void 0 : formatters[key]) == null ? void 0 : _a.formatter) ? (_b = formatters[key]) == null ? void 0 : _b.formatter : formatters == null ? void 0 : formatters[key];
|
|
3487
3486
|
const formattedValue = formatterFn && typeof formatterFn === "function" ? formatterFn(value, fieldContext) : value;
|
|
3488
|
-
const shouldValidateField = !((
|
|
3487
|
+
const shouldValidateField = !((obscuredFields == null ? void 0 : obscuredFields.includes(key)) && (defaultData == null ? void 0 : defaultData[key]) === value && !!(defaultData == null ? void 0 : defaultData[key]));
|
|
3489
3488
|
if (shouldValidateField && value) {
|
|
3490
3489
|
asyncValidate(key, fieldContext.state, mode);
|
|
3491
3490
|
}
|
|
@@ -3504,7 +3503,7 @@ function init({
|
|
|
3504
3503
|
schema,
|
|
3505
3504
|
defaultData,
|
|
3506
3505
|
fieldProblems,
|
|
3507
|
-
|
|
3506
|
+
obscuredFields,
|
|
3508
3507
|
formatters,
|
|
3509
3508
|
staticValidate,
|
|
3510
3509
|
asyncValidate
|
|
@@ -3516,7 +3515,7 @@ function init({
|
|
|
3516
3515
|
mode: "blur",
|
|
3517
3516
|
formatters,
|
|
3518
3517
|
defaultData,
|
|
3519
|
-
|
|
3518
|
+
obscuredFields,
|
|
3520
3519
|
fieldContext: {
|
|
3521
3520
|
state: {
|
|
3522
3521
|
data: defaultData
|
|
@@ -3572,7 +3571,7 @@ function init({
|
|
|
3572
3571
|
valid: {},
|
|
3573
3572
|
errors: {},
|
|
3574
3573
|
fieldProblems: {},
|
|
3575
|
-
|
|
3574
|
+
obscuredFields
|
|
3576
3575
|
});
|
|
3577
3576
|
return formData;
|
|
3578
3577
|
}
|
|
@@ -3589,7 +3588,7 @@ function reducer({
|
|
|
3589
3588
|
schema,
|
|
3590
3589
|
selectedSchema,
|
|
3591
3590
|
formValue,
|
|
3592
|
-
|
|
3591
|
+
obscuredFields,
|
|
3593
3592
|
fieldProblems,
|
|
3594
3593
|
defaultData
|
|
3595
3594
|
}) => {
|
|
@@ -3652,7 +3651,7 @@ function reducer({
|
|
|
3652
3651
|
schema,
|
|
3653
3652
|
defaultData,
|
|
3654
3653
|
fieldProblems,
|
|
3655
|
-
|
|
3654
|
+
obscuredFields,
|
|
3656
3655
|
staticValidate,
|
|
3657
3656
|
asyncValidate
|
|
3658
3657
|
});
|
|
@@ -3689,7 +3688,7 @@ function reducer({
|
|
|
3689
3688
|
value,
|
|
3690
3689
|
mode,
|
|
3691
3690
|
defaultData,
|
|
3692
|
-
|
|
3691
|
+
obscuredFields,
|
|
3693
3692
|
formatters,
|
|
3694
3693
|
fieldContext: {
|
|
3695
3694
|
state: state2
|
|
@@ -3752,7 +3751,7 @@ function reducer({
|
|
|
3752
3751
|
value: state2.data[cur],
|
|
3753
3752
|
mode: "blur",
|
|
3754
3753
|
defaultData,
|
|
3755
|
-
|
|
3754
|
+
obscuredFields,
|
|
3756
3755
|
formatters,
|
|
3757
3756
|
fieldContext: {
|
|
3758
3757
|
state: state2
|
|
@@ -3884,7 +3883,7 @@ function useForm({
|
|
|
3884
3883
|
rules: rules2,
|
|
3885
3884
|
asyncRules,
|
|
3886
3885
|
fieldProblems,
|
|
3887
|
-
|
|
3886
|
+
obscuredFields,
|
|
3888
3887
|
optionalFields,
|
|
3889
3888
|
formatters,
|
|
3890
3889
|
shouldValidate = false
|
|
@@ -3912,11 +3911,11 @@ function useForm({
|
|
|
3912
3911
|
schema: getSchema,
|
|
3913
3912
|
defaultData,
|
|
3914
3913
|
fieldProblems,
|
|
3915
|
-
|
|
3914
|
+
obscuredFields,
|
|
3916
3915
|
formatters,
|
|
3917
3916
|
staticValidate: triggerStaticValidation,
|
|
3918
3917
|
asyncValidate: triggerAsyncValidation
|
|
3919
|
-
}), [getSchema, defaultData, fieldProblems,
|
|
3918
|
+
}), [getSchema, defaultData, fieldProblems, obscuredFields, formatters, triggerStaticValidation, triggerAsyncValidation]);
|
|
3920
3919
|
const [state2, dispatch] = useReducer(getReducer(), getInitialData(), init);
|
|
3921
3920
|
const isValid = useMemo(() => {
|
|
3922
3921
|
var _a;
|
|
@@ -3966,17 +3965,17 @@ function useForm({
|
|
|
3966
3965
|
value,
|
|
3967
3966
|
mode,
|
|
3968
3967
|
defaultData,
|
|
3969
|
-
|
|
3968
|
+
obscuredFields
|
|
3970
3969
|
});
|
|
3971
|
-
}, [defaultData,
|
|
3970
|
+
}, [defaultData, obscuredFields, getTargetValue]);
|
|
3972
3971
|
const triggerValidation = useCallback((selectedSchema) => {
|
|
3973
3972
|
dispatch({
|
|
3974
3973
|
type: "validateForm",
|
|
3975
3974
|
selectedSchema,
|
|
3976
3975
|
defaultData,
|
|
3977
|
-
|
|
3976
|
+
obscuredFields
|
|
3978
3977
|
});
|
|
3979
|
-
}, [defaultData,
|
|
3978
|
+
}, [defaultData, obscuredFields]);
|
|
3980
3979
|
useEffect(() => {
|
|
3981
3980
|
const newSchema = getRequiredFields(state2.data);
|
|
3982
3981
|
if (!doArraysMatch(state2.schema, newSchema)) {
|
|
@@ -4806,12 +4805,9 @@ const SelectButtonContentSingle = ({
|
|
|
4806
4805
|
}) => {
|
|
4807
4806
|
const activeSingle = active.pop();
|
|
4808
4807
|
return !showList || !filterable ? jsxs(Fragment, {
|
|
4809
|
-
children: [(activeSingle == null ? void 0 : activeSingle.
|
|
4808
|
+
children: [(activeSingle == null ? void 0 : activeSingle.icon) && jsx("span", {
|
|
4810
4809
|
className: "adyen-kyc-dropdown-button__icon",
|
|
4811
|
-
|
|
4812
|
-
children: jsx("use", {
|
|
4813
|
-
href: activeSingle.sprite
|
|
4814
|
-
})
|
|
4810
|
+
children: activeSingle.icon
|
|
4815
4811
|
}), isSearch && jsx(Icon, {
|
|
4816
4812
|
name: "search",
|
|
4817
4813
|
className: "adyen-kyc-dropdown-button-search__icon"
|
|
@@ -4933,20 +4929,10 @@ const SelectListItem = ({
|
|
|
4933
4929
|
checked: selected,
|
|
4934
4930
|
name: `adyen-kyc-dropdown-element__checkbox adyen-kyc-dropdown-element__checkbox--${item.id}`
|
|
4935
4931
|
}) : children ? [children] : jsxs(Fragment, {
|
|
4936
|
-
children: [
|
|
4937
|
-
className: "adyen-kyc-dropdown-element__icon",
|
|
4938
|
-
alt: item.name,
|
|
4939
|
-
src: item.icon
|
|
4940
|
-
}) : jsx("svg", {
|
|
4932
|
+
children: [item.icon && jsx("span", {
|
|
4941
4933
|
className: "adyen-kyc-dropdown-element__icon",
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
href: item.sprite
|
|
4945
|
-
})
|
|
4946
|
-
}), !item.description ? jsx("span", {
|
|
4947
|
-
className: "adyen-kyc-dropdown-element__label",
|
|
4948
|
-
children: item.name
|
|
4949
|
-
}) : jsxs(Fragment, {
|
|
4934
|
+
children: item.icon
|
|
4935
|
+
}), item.description ? jsxs(Fragment, {
|
|
4950
4936
|
children: [jsx("span", {
|
|
4951
4937
|
className: "adyen-kyc-dropdown-element__label adl-u-font-weight-semi-bold",
|
|
4952
4938
|
children: item.name
|
|
@@ -4954,6 +4940,9 @@ const SelectListItem = ({
|
|
|
4954
4940
|
className: "adyen-kyc-dropdown-element-description__text",
|
|
4955
4941
|
children: item.description
|
|
4956
4942
|
})]
|
|
4943
|
+
}) : jsx("span", {
|
|
4944
|
+
className: "adyen-kyc-dropdown-element__label",
|
|
4945
|
+
children: item.name
|
|
4957
4946
|
})]
|
|
4958
4947
|
})
|
|
4959
4948
|
});
|
|
@@ -5254,7 +5243,308 @@ const Select = ({
|
|
|
5254
5243
|
})]
|
|
5255
5244
|
});
|
|
5256
5245
|
};
|
|
5257
|
-
const
|
|
5246
|
+
const Flag$1 = "";
|
|
5247
|
+
const isIntersectionObserverSupported = typeof IntersectionObserver === "function";
|
|
5248
|
+
function useIsElementVisible(ref, fallback = true) {
|
|
5249
|
+
const [isOnScreen, setIsOnScreen] = useState(isIntersectionObserverSupported ? false : fallback);
|
|
5250
|
+
const observerRef = useRef();
|
|
5251
|
+
useEffect(() => {
|
|
5252
|
+
if (!isIntersectionObserverSupported)
|
|
5253
|
+
return;
|
|
5254
|
+
observerRef.current = new IntersectionObserver(([entry]) => setIsOnScreen(entry.isIntersecting));
|
|
5255
|
+
}, []);
|
|
5256
|
+
useEffect(() => {
|
|
5257
|
+
var _a;
|
|
5258
|
+
if (!ref.current)
|
|
5259
|
+
return;
|
|
5260
|
+
(_a = observerRef.current) == null ? void 0 : _a.observe(ref.current);
|
|
5261
|
+
return () => {
|
|
5262
|
+
var _a2;
|
|
5263
|
+
(_a2 = observerRef.current) == null ? void 0 : _a2.disconnect();
|
|
5264
|
+
};
|
|
5265
|
+
}, [ref]);
|
|
5266
|
+
return isOnScreen;
|
|
5267
|
+
}
|
|
5268
|
+
const logger$r = createLogger("Flag");
|
|
5269
|
+
const flagImports = /* @__PURE__ */ Object.assign({
|
|
5270
|
+
"../../../../assets/flags/ad.svg": () => import("./ad-e09b987a.mjs"),
|
|
5271
|
+
"../../../../assets/flags/ae.svg": () => import("./ae-8ca1be27.mjs"),
|
|
5272
|
+
"../../../../assets/flags/af.svg": () => import("./af-342e1bf5.mjs"),
|
|
5273
|
+
"../../../../assets/flags/ag.svg": () => import("./ag-997e3f88.mjs"),
|
|
5274
|
+
"../../../../assets/flags/ai.svg": () => import("./ai-402dc201.mjs"),
|
|
5275
|
+
"../../../../assets/flags/al.svg": () => import("./al-38b31dad.mjs"),
|
|
5276
|
+
"../../../../assets/flags/am.svg": () => import("./am-bc1403ea.mjs"),
|
|
5277
|
+
"../../../../assets/flags/an.svg": () => import("./an-70336f96.mjs"),
|
|
5278
|
+
"../../../../assets/flags/ao.svg": () => import("./ao-eedf3279.mjs"),
|
|
5279
|
+
"../../../../assets/flags/aq.svg": () => import("./aq-2220e7e0.mjs"),
|
|
5280
|
+
"../../../../assets/flags/ar.svg": () => import("./ar-87abe42d.mjs"),
|
|
5281
|
+
"../../../../assets/flags/as.svg": () => import("./as-6e35c5ec.mjs"),
|
|
5282
|
+
"../../../../assets/flags/at.svg": () => import("./at-4310d424.mjs"),
|
|
5283
|
+
"../../../../assets/flags/au.svg": () => import("./au-50f94ba8.mjs"),
|
|
5284
|
+
"../../../../assets/flags/aw.svg": () => import("./aw-97918c9f.mjs"),
|
|
5285
|
+
"../../../../assets/flags/ax.svg": () => import("./ax-567f3585.mjs"),
|
|
5286
|
+
"../../../../assets/flags/az.svg": () => import("./az-85dbb96d.mjs"),
|
|
5287
|
+
"../../../../assets/flags/ba.svg": () => import("./ba-8afe4a33.mjs"),
|
|
5288
|
+
"../../../../assets/flags/bb.svg": () => import("./bb-c4d79528.mjs"),
|
|
5289
|
+
"../../../../assets/flags/bd.svg": () => import("./bd-0f87f359.mjs"),
|
|
5290
|
+
"../../../../assets/flags/be.svg": () => import("./be-63be2126.mjs"),
|
|
5291
|
+
"../../../../assets/flags/bf.svg": () => import("./bf-621f8737.mjs"),
|
|
5292
|
+
"../../../../assets/flags/bg.svg": () => import("./bg-30061757.mjs"),
|
|
5293
|
+
"../../../../assets/flags/bh.svg": () => import("./bh-a858ad79.mjs"),
|
|
5294
|
+
"../../../../assets/flags/bi.svg": () => import("./bi-c08e68ba.mjs"),
|
|
5295
|
+
"../../../../assets/flags/bj.svg": () => import("./bj-8e17226d.mjs"),
|
|
5296
|
+
"../../../../assets/flags/bl.svg": () => import("./bl-b7b32ae6.mjs"),
|
|
5297
|
+
"../../../../assets/flags/bm.svg": () => import("./bm-b728ab56.mjs"),
|
|
5298
|
+
"../../../../assets/flags/bn.svg": () => import("./bn-c706c05b.mjs"),
|
|
5299
|
+
"../../../../assets/flags/bo.svg": () => import("./bo-1fad8399.mjs"),
|
|
5300
|
+
"../../../../assets/flags/br.svg": () => import("./br-11b9980d.mjs"),
|
|
5301
|
+
"../../../../assets/flags/bs.svg": () => import("./bs-090f5bd7.mjs"),
|
|
5302
|
+
"../../../../assets/flags/bt.svg": () => import("./bt-c56334d3.mjs"),
|
|
5303
|
+
"../../../../assets/flags/bv.svg": () => import("./bv-570dcd11.mjs"),
|
|
5304
|
+
"../../../../assets/flags/bw.svg": () => import("./bw-5de93ae1.mjs"),
|
|
5305
|
+
"../../../../assets/flags/by.svg": () => import("./by-e2457131.mjs"),
|
|
5306
|
+
"../../../../assets/flags/bz.svg": () => import("./bz-30bbd0de.mjs"),
|
|
5307
|
+
"../../../../assets/flags/ca.svg": () => import("./ca-39c0e436.mjs"),
|
|
5308
|
+
"../../../../assets/flags/cc.svg": () => import("./cc-ddc2a1db.mjs"),
|
|
5309
|
+
"../../../../assets/flags/cd.svg": () => import("./cd-eab01270.mjs"),
|
|
5310
|
+
"../../../../assets/flags/cf.svg": () => import("./cf-50f7241b.mjs"),
|
|
5311
|
+
"../../../../assets/flags/cg.svg": () => import("./cg-e87aa981.mjs"),
|
|
5312
|
+
"../../../../assets/flags/ch.svg": () => import("./ch-9637f347.mjs"),
|
|
5313
|
+
"../../../../assets/flags/ci.svg": () => import("./ci-41814a2b.mjs"),
|
|
5314
|
+
"../../../../assets/flags/ck.svg": () => import("./ck-60b0d769.mjs"),
|
|
5315
|
+
"../../../../assets/flags/cl.svg": () => import("./cl-931fd7da.mjs"),
|
|
5316
|
+
"../../../../assets/flags/cm.svg": () => import("./cm-55c02792.mjs"),
|
|
5317
|
+
"../../../../assets/flags/cn.svg": () => import("./cn-1526dac5.mjs"),
|
|
5318
|
+
"../../../../assets/flags/co.svg": () => import("./co-c7ada338.mjs"),
|
|
5319
|
+
"../../../../assets/flags/cr.svg": () => import("./cr-bac1e451.mjs"),
|
|
5320
|
+
"../../../../assets/flags/cu.svg": () => import("./cu-af98b602.mjs"),
|
|
5321
|
+
"../../../../assets/flags/cv.svg": () => import("./cv-575fe55b.mjs"),
|
|
5322
|
+
"../../../../assets/flags/cw.svg": () => import("./cw-6f1c60ce.mjs"),
|
|
5323
|
+
"../../../../assets/flags/cx.svg": () => import("./cx-7687e3a9.mjs"),
|
|
5324
|
+
"../../../../assets/flags/cy.svg": () => import("./cy-eeff5dbd.mjs"),
|
|
5325
|
+
"../../../../assets/flags/cz.svg": () => import("./cz-24eff96c.mjs"),
|
|
5326
|
+
"../../../../assets/flags/de.svg": () => import("./de-8e2b6f6c.mjs"),
|
|
5327
|
+
"../../../../assets/flags/dj.svg": () => import("./dj-e0f41411.mjs"),
|
|
5328
|
+
"../../../../assets/flags/dk.svg": () => import("./dk-a5073c43.mjs"),
|
|
5329
|
+
"../../../../assets/flags/dm.svg": () => import("./dm-9a3ee195.mjs"),
|
|
5330
|
+
"../../../../assets/flags/do.svg": () => import("./do-5aa635df.mjs"),
|
|
5331
|
+
"../../../../assets/flags/dz.svg": () => import("./dz-7452e74d.mjs"),
|
|
5332
|
+
"../../../../assets/flags/ec.svg": () => import("./ec-c68c940e.mjs"),
|
|
5333
|
+
"../../../../assets/flags/ee.svg": () => import("./ee-1dbd9a40.mjs"),
|
|
5334
|
+
"../../../../assets/flags/eg.svg": () => import("./eg-40f9b2b5.mjs"),
|
|
5335
|
+
"../../../../assets/flags/eh.svg": () => import("./eh-51f4bae2.mjs"),
|
|
5336
|
+
"../../../../assets/flags/er.svg": () => import("./er-61cda111.mjs"),
|
|
5337
|
+
"../../../../assets/flags/es.svg": () => import("./es-78250575.mjs"),
|
|
5338
|
+
"../../../../assets/flags/et.svg": () => import("./et-63dc8d1e.mjs"),
|
|
5339
|
+
"../../../../assets/flags/fi.svg": () => import("./fi-e2d1f3df.mjs"),
|
|
5340
|
+
"../../../../assets/flags/fj.svg": () => import("./fj-02f497c5.mjs"),
|
|
5341
|
+
"../../../../assets/flags/fk.svg": () => import("./fk-56af40af.mjs"),
|
|
5342
|
+
"../../../../assets/flags/fm.svg": () => import("./fm-0292f2ce.mjs"),
|
|
5343
|
+
"../../../../assets/flags/fo.svg": () => import("./fo-5063373c.mjs"),
|
|
5344
|
+
"../../../../assets/flags/fr.svg": () => import("./fr-fb20da2b.mjs"),
|
|
5345
|
+
"../../../../assets/flags/fx.svg": () => import("./fx-ca4da212.mjs"),
|
|
5346
|
+
"../../../../assets/flags/ga.svg": () => import("./ga-31f5afca.mjs"),
|
|
5347
|
+
"../../../../assets/flags/gb.svg": () => import("./gb-4ae48840.mjs"),
|
|
5348
|
+
"../../../../assets/flags/gd.svg": () => import("./gd-25e40717.mjs"),
|
|
5349
|
+
"../../../../assets/flags/ge.svg": () => import("./ge-939c150e.mjs"),
|
|
5350
|
+
"../../../../assets/flags/gf.svg": () => import("./gf-b8736c20.mjs"),
|
|
5351
|
+
"../../../../assets/flags/gg.svg": () => import("./gg-4c532713.mjs"),
|
|
5352
|
+
"../../../../assets/flags/gh.svg": () => import("./gh-7b187c5f.mjs"),
|
|
5353
|
+
"../../../../assets/flags/gi.svg": () => import("./gi-e59b72be.mjs"),
|
|
5354
|
+
"../../../../assets/flags/gl.svg": () => import("./gl-31e9b8e5.mjs"),
|
|
5355
|
+
"../../../../assets/flags/gm.svg": () => import("./gm-975999b2.mjs"),
|
|
5356
|
+
"../../../../assets/flags/gn.svg": () => import("./gn-3701984d.mjs"),
|
|
5357
|
+
"../../../../assets/flags/gp.svg": () => import("./gp-40fbae20.mjs"),
|
|
5358
|
+
"../../../../assets/flags/gq.svg": () => import("./gq-86021eca.mjs"),
|
|
5359
|
+
"../../../../assets/flags/gr.svg": () => import("./gr-3b0c7597.mjs"),
|
|
5360
|
+
"../../../../assets/flags/gs.svg": () => import("./gs-00bc8674.mjs"),
|
|
5361
|
+
"../../../../assets/flags/gt.svg": () => import("./gt-05eb5f87.mjs"),
|
|
5362
|
+
"../../../../assets/flags/gu.svg": () => import("./gu-497f9b0b.mjs"),
|
|
5363
|
+
"../../../../assets/flags/gw.svg": () => import("./gw-b54f1365.mjs"),
|
|
5364
|
+
"../../../../assets/flags/gy.svg": () => import("./gy-e917fca1.mjs"),
|
|
5365
|
+
"../../../../assets/flags/hk.svg": () => import("./hk-ddd60484.mjs"),
|
|
5366
|
+
"../../../../assets/flags/hm.svg": () => import("./hm-03a2df0b.mjs"),
|
|
5367
|
+
"../../../../assets/flags/hn.svg": () => import("./hn-1748eed1.mjs"),
|
|
5368
|
+
"../../../../assets/flags/hr.svg": () => import("./hr-6b1bd9c8.mjs"),
|
|
5369
|
+
"../../../../assets/flags/ht.svg": () => import("./ht-13a1ab82.mjs"),
|
|
5370
|
+
"../../../../assets/flags/hu.svg": () => import("./hu-81872148.mjs"),
|
|
5371
|
+
"../../../../assets/flags/id.svg": () => import("./id-2c9c4235.mjs"),
|
|
5372
|
+
"../../../../assets/flags/ie.svg": () => import("./ie-ef96fd76.mjs"),
|
|
5373
|
+
"../../../../assets/flags/il.svg": () => import("./il-20c3ccd4.mjs"),
|
|
5374
|
+
"../../../../assets/flags/im.svg": () => import("./im-eb7a7143.mjs"),
|
|
5375
|
+
"../../../../assets/flags/in.svg": () => import("./in-67c16223.mjs"),
|
|
5376
|
+
"../../../../assets/flags/io.svg": () => import("./io-9adeb690.mjs"),
|
|
5377
|
+
"../../../../assets/flags/iq.svg": () => import("./iq-61ffc408.mjs"),
|
|
5378
|
+
"../../../../assets/flags/ir.svg": () => import("./ir-bc3341c2.mjs"),
|
|
5379
|
+
"../../../../assets/flags/is.svg": () => import("./is-7c19d0ff.mjs"),
|
|
5380
|
+
"../../../../assets/flags/it.svg": () => import("./it-fa0dd04c.mjs"),
|
|
5381
|
+
"../../../../assets/flags/je.svg": () => import("./je-a29e157d.mjs"),
|
|
5382
|
+
"../../../../assets/flags/jm.svg": () => import("./jm-53f8ddb8.mjs"),
|
|
5383
|
+
"../../../../assets/flags/jo.svg": () => import("./jo-89d49ef8.mjs"),
|
|
5384
|
+
"../../../../assets/flags/jp.svg": () => import("./jp-f97d7972.mjs"),
|
|
5385
|
+
"../../../../assets/flags/ke.svg": () => import("./ke-545eb9cb.mjs"),
|
|
5386
|
+
"../../../../assets/flags/kg.svg": () => import("./kg-066a524e.mjs"),
|
|
5387
|
+
"../../../../assets/flags/kh.svg": () => import("./kh-39620e7b.mjs"),
|
|
5388
|
+
"../../../../assets/flags/ki.svg": () => import("./ki-900be23e.mjs"),
|
|
5389
|
+
"../../../../assets/flags/km.svg": () => import("./km-b4e8c8ba.mjs"),
|
|
5390
|
+
"../../../../assets/flags/kn.svg": () => import("./kn-8ec9ee75.mjs"),
|
|
5391
|
+
"../../../../assets/flags/kp.svg": () => import("./kp-1cdc64be.mjs"),
|
|
5392
|
+
"../../../../assets/flags/kr.svg": () => import("./kr-53eac37f.mjs"),
|
|
5393
|
+
"../../../../assets/flags/kw.svg": () => import("./kw-c4347b38.mjs"),
|
|
5394
|
+
"../../../../assets/flags/ky.svg": () => import("./ky-a104dc86.mjs"),
|
|
5395
|
+
"../../../../assets/flags/kz.svg": () => import("./kz-d64ba71d.mjs"),
|
|
5396
|
+
"../../../../assets/flags/la.svg": () => import("./la-04577eb2.mjs"),
|
|
5397
|
+
"../../../../assets/flags/lb.svg": () => import("./lb-c2470dd0.mjs"),
|
|
5398
|
+
"../../../../assets/flags/lc.svg": () => import("./lc-58fb8706.mjs"),
|
|
5399
|
+
"../../../../assets/flags/li.svg": () => import("./li-c887f5b7.mjs"),
|
|
5400
|
+
"../../../../assets/flags/lk.svg": () => import("./lk-d10f8746.mjs"),
|
|
5401
|
+
"../../../../assets/flags/lr.svg": () => import("./lr-8422af8e.mjs"),
|
|
5402
|
+
"../../../../assets/flags/ls.svg": () => import("./ls-bdcefbbc.mjs"),
|
|
5403
|
+
"../../../../assets/flags/lt.svg": () => import("./lt-07e70fec.mjs"),
|
|
5404
|
+
"../../../../assets/flags/lu.svg": () => import("./lu-b7c93ece.mjs"),
|
|
5405
|
+
"../../../../assets/flags/lv.svg": () => import("./lv-97900494.mjs"),
|
|
5406
|
+
"../../../../assets/flags/ly.svg": () => import("./ly-86ceab07.mjs"),
|
|
5407
|
+
"../../../../assets/flags/ma.svg": () => import("./ma-21b21bdf.mjs"),
|
|
5408
|
+
"../../../../assets/flags/mc.svg": () => import("./mc-f23b73f0.mjs"),
|
|
5409
|
+
"../../../../assets/flags/md.svg": () => import("./md-82ed1b49.mjs"),
|
|
5410
|
+
"../../../../assets/flags/me.svg": () => import("./me-c45ff596.mjs"),
|
|
5411
|
+
"../../../../assets/flags/mf.svg": () => import("./mf-11563bd1.mjs"),
|
|
5412
|
+
"../../../../assets/flags/mg.svg": () => import("./mg-f5f0546b.mjs"),
|
|
5413
|
+
"../../../../assets/flags/mh.svg": () => import("./mh-06a860ed.mjs"),
|
|
5414
|
+
"../../../../assets/flags/mk.svg": () => import("./mk-91356e13.mjs"),
|
|
5415
|
+
"../../../../assets/flags/ml.svg": () => import("./ml-c3f2014e.mjs"),
|
|
5416
|
+
"../../../../assets/flags/mm.svg": () => import("./mm-d138bd76.mjs"),
|
|
5417
|
+
"../../../../assets/flags/mn.svg": () => import("./mn-9c4664d8.mjs"),
|
|
5418
|
+
"../../../../assets/flags/mo.svg": () => import("./mo-54bd2fbe.mjs"),
|
|
5419
|
+
"../../../../assets/flags/mp.svg": () => import("./mp-796516e8.mjs"),
|
|
5420
|
+
"../../../../assets/flags/mq.svg": () => import("./mq-3511a92a.mjs"),
|
|
5421
|
+
"../../../../assets/flags/mr.svg": () => import("./mr-a4b18b6d.mjs"),
|
|
5422
|
+
"../../../../assets/flags/ms.svg": () => import("./ms-91e4dcef.mjs"),
|
|
5423
|
+
"../../../../assets/flags/mt.svg": () => import("./mt-9b58b6a6.mjs"),
|
|
5424
|
+
"../../../../assets/flags/mu.svg": () => import("./mu-2307760c.mjs"),
|
|
5425
|
+
"../../../../assets/flags/mv.svg": () => import("./mv-32c9699b.mjs"),
|
|
5426
|
+
"../../../../assets/flags/mw.svg": () => import("./mw-2b9505ac.mjs"),
|
|
5427
|
+
"../../../../assets/flags/mx.svg": () => import("./mx-98a49b74.mjs"),
|
|
5428
|
+
"../../../../assets/flags/my.svg": () => import("./my-217f9384.mjs"),
|
|
5429
|
+
"../../../../assets/flags/mz.svg": () => import("./mz-92e1e39c.mjs"),
|
|
5430
|
+
"../../../../assets/flags/na.svg": () => import("./na-3c30775f.mjs"),
|
|
5431
|
+
"../../../../assets/flags/nc.svg": () => import("./nc-c80aff50.mjs"),
|
|
5432
|
+
"../../../../assets/flags/ne.svg": () => import("./ne-b38208ab.mjs"),
|
|
5433
|
+
"../../../../assets/flags/nf.svg": () => import("./nf-780a37dd.mjs"),
|
|
5434
|
+
"../../../../assets/flags/ng.svg": () => import("./ng-f5ea4118.mjs"),
|
|
5435
|
+
"../../../../assets/flags/ni.svg": () => import("./ni-60b41460.mjs"),
|
|
5436
|
+
"../../../../assets/flags/nl.svg": () => import("./nl-975a8624.mjs"),
|
|
5437
|
+
"../../../../assets/flags/no.svg": () => import("./no-952bf512.mjs"),
|
|
5438
|
+
"../../../../assets/flags/np.svg": () => import("./np-5135aa90.mjs"),
|
|
5439
|
+
"../../../../assets/flags/nr.svg": () => import("./nr-cecf1f05.mjs"),
|
|
5440
|
+
"../../../../assets/flags/nu.svg": () => import("./nu-c1ad2dc9.mjs"),
|
|
5441
|
+
"../../../../assets/flags/nz.svg": () => import("./nz-70a6e29f.mjs"),
|
|
5442
|
+
"../../../../assets/flags/om.svg": () => import("./om-e5c99d1e.mjs"),
|
|
5443
|
+
"../../../../assets/flags/pa.svg": () => import("./pa-0e401aff.mjs"),
|
|
5444
|
+
"../../../../assets/flags/pe.svg": () => import("./pe-823d3b3f.mjs"),
|
|
5445
|
+
"../../../../assets/flags/pf.svg": () => import("./pf-5c60fe59.mjs"),
|
|
5446
|
+
"../../../../assets/flags/pg.svg": () => import("./pg-71e8aaec.mjs"),
|
|
5447
|
+
"../../../../assets/flags/ph.svg": () => import("./ph-52f55ac4.mjs"),
|
|
5448
|
+
"../../../../assets/flags/pk.svg": () => import("./pk-372b07db.mjs"),
|
|
5449
|
+
"../../../../assets/flags/pl.svg": () => import("./pl-2c472f58.mjs"),
|
|
5450
|
+
"../../../../assets/flags/pm.svg": () => import("./pm-2195603b.mjs"),
|
|
5451
|
+
"../../../../assets/flags/pn.svg": () => import("./pn-ec73a623.mjs"),
|
|
5452
|
+
"../../../../assets/flags/pr.svg": () => import("./pr-8f159ad6.mjs"),
|
|
5453
|
+
"../../../../assets/flags/ps.svg": () => import("./ps-34dd64b7.mjs"),
|
|
5454
|
+
"../../../../assets/flags/pt.svg": () => import("./pt-b210cd4c.mjs"),
|
|
5455
|
+
"../../../../assets/flags/pw.svg": () => import("./pw-a474545d.mjs"),
|
|
5456
|
+
"../../../../assets/flags/py.svg": () => import("./py-e271f15f.mjs"),
|
|
5457
|
+
"../../../../assets/flags/qa.svg": () => import("./qa-a7ad70ed.mjs"),
|
|
5458
|
+
"../../../../assets/flags/re.svg": () => import("./re-a1440f32.mjs"),
|
|
5459
|
+
"../../../../assets/flags/ro.svg": () => import("./ro-8a071708.mjs"),
|
|
5460
|
+
"../../../../assets/flags/rs.svg": () => import("./rs-f3ea0f97.mjs"),
|
|
5461
|
+
"../../../../assets/flags/ru.svg": () => import("./ru-edd59839.mjs"),
|
|
5462
|
+
"../../../../assets/flags/rw.svg": () => import("./rw-df210dff.mjs"),
|
|
5463
|
+
"../../../../assets/flags/sa.svg": () => import("./sa-18c28dc4.mjs"),
|
|
5464
|
+
"../../../../assets/flags/sb.svg": () => import("./sb-35c0ab8d.mjs"),
|
|
5465
|
+
"../../../../assets/flags/sc.svg": () => import("./sc-82eb7101.mjs"),
|
|
5466
|
+
"../../../../assets/flags/sd.svg": () => import("./sd-dc5fb244.mjs"),
|
|
5467
|
+
"../../../../assets/flags/se.svg": () => import("./se-0413b6f1.mjs"),
|
|
5468
|
+
"../../../../assets/flags/sg.svg": () => import("./sg-8ff78597.mjs"),
|
|
5469
|
+
"../../../../assets/flags/sh.svg": () => import("./sh-7b636341.mjs"),
|
|
5470
|
+
"../../../../assets/flags/si.svg": () => import("./si-2c09bba0.mjs"),
|
|
5471
|
+
"../../../../assets/flags/sj.svg": () => import("./sj-8aff2627.mjs"),
|
|
5472
|
+
"../../../../assets/flags/sk.svg": () => import("./sk-8da1fee7.mjs"),
|
|
5473
|
+
"../../../../assets/flags/sl.svg": () => import("./sl-92cb9116.mjs"),
|
|
5474
|
+
"../../../../assets/flags/sm.svg": () => import("./sm-6fd64a6a.mjs"),
|
|
5475
|
+
"../../../../assets/flags/sn.svg": () => import("./sn-57e8c34b.mjs"),
|
|
5476
|
+
"../../../../assets/flags/so.svg": () => import("./so-f2f0ac03.mjs"),
|
|
5477
|
+
"../../../../assets/flags/sr.svg": () => import("./sr-7869b748.mjs"),
|
|
5478
|
+
"../../../../assets/flags/ss.svg": () => import("./ss-8e9c79ca.mjs"),
|
|
5479
|
+
"../../../../assets/flags/st.svg": () => import("./st-6b3e911c.mjs"),
|
|
5480
|
+
"../../../../assets/flags/sv.svg": () => import("./sv-922ba5ea.mjs"),
|
|
5481
|
+
"../../../../assets/flags/sx.svg": () => import("./sx-c078bfd1.mjs"),
|
|
5482
|
+
"../../../../assets/flags/sy.svg": () => import("./sy-995ec1ee.mjs"),
|
|
5483
|
+
"../../../../assets/flags/sz.svg": () => import("./sz-da33c6e8.mjs"),
|
|
5484
|
+
"../../../../assets/flags/tc.svg": () => import("./tc-1a465526.mjs"),
|
|
5485
|
+
"../../../../assets/flags/td.svg": () => import("./td-a7ff3830.mjs"),
|
|
5486
|
+
"../../../../assets/flags/tf.svg": () => import("./tf-c71eed4a.mjs"),
|
|
5487
|
+
"../../../../assets/flags/tg.svg": () => import("./tg-613f7f5a.mjs"),
|
|
5488
|
+
"../../../../assets/flags/th.svg": () => import("./th-f517ca34.mjs"),
|
|
5489
|
+
"../../../../assets/flags/tj.svg": () => import("./tj-b99ac64f.mjs"),
|
|
5490
|
+
"../../../../assets/flags/tk.svg": () => import("./tk-c0dfeac1.mjs"),
|
|
5491
|
+
"../../../../assets/flags/tl.svg": () => import("./tl-35cc3595.mjs"),
|
|
5492
|
+
"../../../../assets/flags/tm.svg": () => import("./tm-0deecc32.mjs"),
|
|
5493
|
+
"../../../../assets/flags/tn.svg": () => import("./tn-190a49a0.mjs"),
|
|
5494
|
+
"../../../../assets/flags/to.svg": () => import("./to-790cac18.mjs"),
|
|
5495
|
+
"../../../../assets/flags/tr.svg": () => import("./tr-1db5a437.mjs"),
|
|
5496
|
+
"../../../../assets/flags/tt.svg": () => import("./tt-85ae901c.mjs"),
|
|
5497
|
+
"../../../../assets/flags/tv.svg": () => import("./tv-9f2b4198.mjs"),
|
|
5498
|
+
"../../../../assets/flags/tw.svg": () => import("./tw-74aa27b3.mjs"),
|
|
5499
|
+
"../../../../assets/flags/tz.svg": () => import("./tz-2a5cf5e6.mjs"),
|
|
5500
|
+
"../../../../assets/flags/ua.svg": () => import("./ua-9fedceaa.mjs"),
|
|
5501
|
+
"../../../../assets/flags/ug.svg": () => import("./ug-1a8fee80.mjs"),
|
|
5502
|
+
"../../../../assets/flags/um.svg": () => import("./um-d774b142.mjs"),
|
|
5503
|
+
"../../../../assets/flags/us.svg": () => import("./us-20ac3d88.mjs"),
|
|
5504
|
+
"../../../../assets/flags/uy.svg": () => import("./uy-c22e1eb1.mjs"),
|
|
5505
|
+
"../../../../assets/flags/uz.svg": () => import("./uz-f8be4086.mjs"),
|
|
5506
|
+
"../../../../assets/flags/va.svg": () => import("./va-d1f00296.mjs"),
|
|
5507
|
+
"../../../../assets/flags/vc.svg": () => import("./vc-0a06f1c2.mjs"),
|
|
5508
|
+
"../../../../assets/flags/ve.svg": () => import("./ve-3bc33c40.mjs"),
|
|
5509
|
+
"../../../../assets/flags/vg.svg": () => import("./vg-3ad787bf.mjs"),
|
|
5510
|
+
"../../../../assets/flags/vi.svg": () => import("./vi-5a78bf74.mjs"),
|
|
5511
|
+
"../../../../assets/flags/vn.svg": () => import("./vn-50e78ae2.mjs"),
|
|
5512
|
+
"../../../../assets/flags/vu.svg": () => import("./vu-72d9304c.mjs"),
|
|
5513
|
+
"../../../../assets/flags/wf.svg": () => import("./wf-8cdbeff9.mjs"),
|
|
5514
|
+
"../../../../assets/flags/ws.svg": () => import("./ws-745fc88c.mjs"),
|
|
5515
|
+
"../../../../assets/flags/ye.svg": () => import("./ye-f4eaca91.mjs"),
|
|
5516
|
+
"../../../../assets/flags/yt.svg": () => import("./yt-93635c9a.mjs"),
|
|
5517
|
+
"../../../../assets/flags/za.svg": () => import("./za-42d70d0b.mjs"),
|
|
5518
|
+
"../../../../assets/flags/zm.svg": () => import("./zm-571a963f.mjs"),
|
|
5519
|
+
"../../../../assets/flags/zw.svg": () => import("./zw-6cf765c3.mjs"),
|
|
5520
|
+
"../../../../assets/flags/zz.svg": () => import("./zz-067ccc58.mjs")
|
|
5521
|
+
});
|
|
5522
|
+
const getLazyLoadedSvgComponent = (country2) => {
|
|
5523
|
+
const importForCountry = flagImports[`../../../../assets/flags/${country2.toLowerCase()}.svg`];
|
|
5524
|
+
if (!importForCountry) {
|
|
5525
|
+
logger$r.error(`No flag available for ${country2}`);
|
|
5526
|
+
return void 0;
|
|
5527
|
+
}
|
|
5528
|
+
return lazy(importForCountry);
|
|
5529
|
+
};
|
|
5530
|
+
const Flag = ({
|
|
5531
|
+
country: country2
|
|
5532
|
+
}) => {
|
|
5533
|
+
const containerRef = useRef(null);
|
|
5534
|
+
const isVisible = useIsElementVisible(containerRef);
|
|
5535
|
+
const placeholder = jsx("span", {
|
|
5536
|
+
className: "adyen-kyc-flag__placeholder"
|
|
5537
|
+
});
|
|
5538
|
+
const LazyLoadedSvgComponent = isVisible ? getLazyLoadedSvgComponent(country2) : void 0;
|
|
5539
|
+
return jsx("span", {
|
|
5540
|
+
ref: containerRef,
|
|
5541
|
+
className: "adyen-kyc-flag__container",
|
|
5542
|
+
children: jsx(Suspense, {
|
|
5543
|
+
fallback: placeholder,
|
|
5544
|
+
children: LazyLoadedSvgComponent ? jsx(LazyLoadedSvgComponent, {}) : placeholder
|
|
5545
|
+
})
|
|
5546
|
+
});
|
|
5547
|
+
};
|
|
5258
5548
|
const COUNTRY_FIELD = ["country"];
|
|
5259
5549
|
function CountryField({
|
|
5260
5550
|
data,
|
|
@@ -5270,19 +5560,15 @@ function CountryField({
|
|
|
5270
5560
|
const {
|
|
5271
5561
|
i18n
|
|
5272
5562
|
} = useI18nContext();
|
|
5273
|
-
const {
|
|
5274
|
-
loadFlags: loadFlags2
|
|
5275
|
-
} = useConfigurationApi();
|
|
5276
5563
|
const {
|
|
5277
5564
|
dataset: countriesFromApi
|
|
5278
5565
|
} = useDataset(datasetIdentifier.country);
|
|
5279
|
-
|
|
5280
|
-
loadFlags2().catch(logger$r.error);
|
|
5281
|
-
}, [loadFlags2]);
|
|
5282
|
-
const countries = countriesFromApi.filter((country2) => allowedCountries ? allowedCountries.includes(country2.id) : true).map((item) => ({
|
|
5566
|
+
const countries = useMemo(() => countriesFromApi.filter((country2) => allowedCountries ? allowedCountries.includes(country2.id) : true).map((item) => ({
|
|
5283
5567
|
...item,
|
|
5284
|
-
|
|
5285
|
-
|
|
5568
|
+
icon: jsx(Flag, {
|
|
5569
|
+
country: item.id
|
|
5570
|
+
})
|
|
5571
|
+
})), [allowedCountries, countriesFromApi]);
|
|
5286
5572
|
return jsx(Field, {
|
|
5287
5573
|
name: "country",
|
|
5288
5574
|
label: (labels2 == null ? void 0 : labels2.country) || i18n.get("country"),
|
|
@@ -5894,6 +6180,10 @@ const displayValueToPureValue = (displayValue, mask) => {
|
|
|
5894
6180
|
const stripPattern = cachedStripPatterns.get(mask) ?? makeStripPattern(mask);
|
|
5895
6181
|
return displayValue.replaceAll(stripPattern, "");
|
|
5896
6182
|
};
|
|
6183
|
+
const isValueObscured = (value) => {
|
|
6184
|
+
var _a;
|
|
6185
|
+
return typeof value === "string" && !!((_a = value.match(/[*]{1,}/)) == null ? void 0 : _a.length);
|
|
6186
|
+
};
|
|
5897
6187
|
const getAvailableInputTokens = (tokens) => {
|
|
5898
6188
|
const availableTokens = [];
|
|
5899
6189
|
for (const token of tokens) {
|
|
@@ -5932,11 +6222,17 @@ const getEagerSuffix = (tokens) => {
|
|
|
5932
6222
|
return suffix;
|
|
5933
6223
|
};
|
|
5934
6224
|
const getPotentialForMoreOptionalInput = (tokens) => tokens.some((token) => token.type === "input" && token.optional);
|
|
5935
|
-
const matchAgainstMask = (pureValue, mask) => {
|
|
6225
|
+
const matchAgainstMask = (pureValue, mask, acceptObscuredValue = false) => {
|
|
5936
6226
|
let tokensToProcess = [...mask.tokens];
|
|
5937
6227
|
let charsToProcess = pureValue;
|
|
5938
6228
|
let charIndex = 0;
|
|
5939
6229
|
let displayValue = "";
|
|
6230
|
+
if (acceptObscuredValue && isValueObscured(pureValue)) {
|
|
6231
|
+
return {
|
|
6232
|
+
outcome: "obscureCorrect",
|
|
6233
|
+
displayValue: pureValue
|
|
6234
|
+
};
|
|
6235
|
+
}
|
|
5940
6236
|
const shiftChars = (increment) => {
|
|
5941
6237
|
charIndex += increment;
|
|
5942
6238
|
charsToProcess = charsToProcess.slice(increment);
|
|
@@ -6045,7 +6341,8 @@ const MaskedInputText = ({
|
|
|
6045
6341
|
readonly = false,
|
|
6046
6342
|
disabled = false,
|
|
6047
6343
|
formatGuidance,
|
|
6048
|
-
classNameModifiers
|
|
6344
|
+
classNameModifiers,
|
|
6345
|
+
acceptObscuredValue = false
|
|
6049
6346
|
}) => {
|
|
6050
6347
|
const hasExistingData = !isEmpty(value);
|
|
6051
6348
|
const [isFocused, setIsFocused] = useState(false);
|
|
@@ -6078,8 +6375,8 @@ const MaskedInputText = ({
|
|
|
6078
6375
|
outcome: "partialCorrect",
|
|
6079
6376
|
displayValue: pureValue
|
|
6080
6377
|
};
|
|
6081
|
-
return matchAgainstMask(transformOnType ? transformOnType(pureValue) : pureValue, mask);
|
|
6082
|
-
}, [mask, transformOnType]);
|
|
6378
|
+
return matchAgainstMask(transformOnType ? transformOnType(pureValue) : pureValue, mask, acceptObscuredValue);
|
|
6379
|
+
}, [mask, transformOnType, acceptObscuredValue]);
|
|
6083
6380
|
const displayValueToPure = useCallback((displayValue2) => {
|
|
6084
6381
|
if (!mask)
|
|
6085
6382
|
return displayValue2;
|
|
@@ -6224,6 +6521,11 @@ const alphanumericInputs = (length, optional = false) => makeArrayOfRepeatedObje
|
|
|
6224
6521
|
allow: /[\dA-Za-z]/,
|
|
6225
6522
|
optional
|
|
6226
6523
|
});
|
|
6524
|
+
const customInputs = (length, regex, optional = false) => makeArrayOfRepeatedObjects(length, {
|
|
6525
|
+
type: "input",
|
|
6526
|
+
allow: regex,
|
|
6527
|
+
optional
|
|
6528
|
+
});
|
|
6227
6529
|
const makeMask = (...tokens) => ({
|
|
6228
6530
|
tokens
|
|
6229
6531
|
});
|
|
@@ -6681,49 +6983,49 @@ const businessRegistrationNumberPatterns = {
|
|
|
6681
6983
|
}
|
|
6682
6984
|
};
|
|
6683
6985
|
const CountryIdNumberPatterns = {
|
|
6684
|
-
[CountryCodes.Brazil]:
|
|
6986
|
+
[CountryCodes.Brazil]: /^\d{11}$/,
|
|
6685
6987
|
[CountryCodes.Canada]: /^\d{9}$/,
|
|
6686
|
-
[CountryCodes.
|
|
6988
|
+
[CountryCodes.Croatia]: /^\d{11}$/,
|
|
6989
|
+
[CountryCodes.Denmark]: /^\d{10}$/,
|
|
6687
6990
|
[CountryCodes.Italy]: /^[A-Z]{6}[0-9]{2}[ABCDEHLMPRST][0-9]{2}[A-Z][0-9]{3}[A-Z]$/,
|
|
6688
6991
|
[CountryCodes.Poland]: /^\d{11}$/,
|
|
6689
6992
|
[CountryCodes.Romania]: /^\d{13}$/,
|
|
6690
|
-
[CountryCodes.Singapore]: /^[
|
|
6691
|
-
[CountryCodes.Spain]: /(^[KL]?\d{7,8}[A-Z]$)|(^[MXYZ]\d{7}[A-Z]$)/,
|
|
6692
|
-
[CountryCodes.Sweden]: /(^\d{6}-\d{4}$)|(^\d{8}-\d{4}$)/,
|
|
6693
|
-
[CountryCodes.UnitedStates]: /^\d{4}$/,
|
|
6694
|
-
US9: /^\d{9}$/
|
|
6695
|
-
};
|
|
6696
|
-
const customPatternsPerIdNumberType = {
|
|
6993
|
+
[CountryCodes.Singapore]: /^[A-Z][0-9]{6}[A-Z]$/,
|
|
6697
6994
|
[CountryCodes.Spain]: {
|
|
6698
|
-
dni: /(^[KL]?\d{
|
|
6699
|
-
nie: /(^[MXYZ]\d{7}[A-Z]$)/
|
|
6995
|
+
dni: /(^[KL]?\d{8}[A-Z]$)/,
|
|
6996
|
+
nie: /(^[MXYZ]\d{7,8}[A-Z]$)/
|
|
6997
|
+
},
|
|
6998
|
+
[CountryCodes.Sweden]: /^\d{10}$|^\d{12}$/,
|
|
6999
|
+
[CountryCodes.UnitedStates]: {
|
|
7000
|
+
ssn: /^\d{9}$/,
|
|
7001
|
+
ssnLastFour: /^\d{4}$/
|
|
6700
7002
|
}
|
|
6701
7003
|
};
|
|
6702
7004
|
const DriversLicenseCardNumberPatterns = {
|
|
6703
|
-
[CountryCodes.NewZealand]: /^[\d]{3}
|
|
7005
|
+
[CountryCodes.NewZealand]: /^[\d]{3}$/,
|
|
7006
|
+
[CountryCodes.Australia]: /^[A-Z0-9]{6,10}$/
|
|
6704
7007
|
};
|
|
6705
7008
|
const DriversLicenseNumberPatterns = {
|
|
6706
|
-
[CountryCodes.Australia]: /^[A-Za-
|
|
6707
|
-
[CountryCodes.HongKong]: /^[A-
|
|
6708
|
-
[CountryCodes.NewZealand]: /^[A-
|
|
7009
|
+
[CountryCodes.Australia]: /^[A-Za-z0-9]{6,11}$/,
|
|
7010
|
+
[CountryCodes.HongKong]: /^[A-Z0-9]{8}$/,
|
|
7011
|
+
[CountryCodes.NewZealand]: /^[A-Z]{2}[0-9]{6}$/
|
|
6709
7012
|
};
|
|
6710
7013
|
const PassportNumberPatterns = {
|
|
6711
7014
|
[CountryCodes.Australia]: /^[A-Z]{1,2}\d{7}$/,
|
|
6712
|
-
[CountryCodes.HongKong]: /^
|
|
6713
|
-
[CountryCodes.NewZealand]: /[A-
|
|
7015
|
+
[CountryCodes.HongKong]: /^[A-Z]{1,2}\d{6}[A-Z0-9]{1,2}$/,
|
|
7016
|
+
[CountryCodes.NewZealand]: /[A-Z]{2}[0-9]{6,7}/
|
|
6714
7017
|
};
|
|
6715
7018
|
const ProofOfIdentityCardPatterns = {
|
|
6716
|
-
[CountryCodes.Australia]: /^[A-Za-z\d]{6,10}$/,
|
|
6717
7019
|
[CountryCodes.HongKong]: /^[A-Z]{1,2}[0-9]{6}[0-9A]$/
|
|
6718
7020
|
};
|
|
6719
7021
|
const validatePatternOnBlur = (pattern) => ({
|
|
6720
7022
|
modes: ["blur"],
|
|
6721
7023
|
validate: (val) => !!val && pattern.test(val)
|
|
6722
7024
|
});
|
|
6723
|
-
const defaultFieldMetadata$
|
|
7025
|
+
const defaultFieldMetadata$8 = {
|
|
6724
7026
|
label: "registrationNumber"
|
|
6725
7027
|
};
|
|
6726
|
-
const defaultFieldConfig$
|
|
7028
|
+
const defaultFieldConfig$8 = {
|
|
6727
7029
|
[CountryCodes.Australia]: {
|
|
6728
7030
|
label: "australianBusinessNumberAcn",
|
|
6729
7031
|
mask: businessRegistrationNumberMasks[CountryCodes.Australia].default,
|
|
@@ -7376,7 +7678,7 @@ const defaultFieldConfig$3 = {
|
|
|
7376
7678
|
const businessRegistrationNumberFields = ["registrationNumber", "exemptedFromRegistrationNumber"];
|
|
7377
7679
|
function BusinessRegistrationNumber(props) {
|
|
7378
7680
|
var _a;
|
|
7379
|
-
const fieldConfig = props.fieldConfig ?? defaultFieldConfig$
|
|
7681
|
+
const fieldConfig = props.fieldConfig ?? defaultFieldConfig$8;
|
|
7380
7682
|
const {
|
|
7381
7683
|
i18n
|
|
7382
7684
|
} = useI18nContext();
|
|
@@ -7392,7 +7694,7 @@ function BusinessRegistrationNumber(props) {
|
|
|
7392
7694
|
const metadata = resolveFieldMetadata(fieldConfig[country2], {
|
|
7393
7695
|
companyType: companyType2,
|
|
7394
7696
|
registrationNumberType
|
|
7395
|
-
}, defaultFieldMetadata$
|
|
7697
|
+
}, defaultFieldMetadata$8);
|
|
7396
7698
|
const mergedProps = mergeFieldMetadataIntoProps("registrationNumber", metadata, {
|
|
7397
7699
|
requiredFields: schema
|
|
7398
7700
|
});
|
|
@@ -7621,7 +7923,7 @@ function AccordionItem({
|
|
|
7621
7923
|
subTitle = "",
|
|
7622
7924
|
expandIconPlacement = Placement.Left,
|
|
7623
7925
|
iconPlacement = Placement.Left,
|
|
7624
|
-
icon
|
|
7926
|
+
icon,
|
|
7625
7927
|
onOpen = noop,
|
|
7626
7928
|
onClose = noop
|
|
7627
7929
|
}) {
|
|
@@ -7885,6 +8187,32 @@ const individualIdNumberOptions = {
|
|
|
7885
8187
|
name: "nie"
|
|
7886
8188
|
}]
|
|
7887
8189
|
};
|
|
8190
|
+
const additionallIdNumberOptions = {
|
|
8191
|
+
[CountryCodes.NewZealand]: [{
|
|
8192
|
+
id: "driversLicense",
|
|
8193
|
+
name: "driversLicense"
|
|
8194
|
+
}, {
|
|
8195
|
+
id: "passport",
|
|
8196
|
+
name: "passportNumber"
|
|
8197
|
+
}],
|
|
8198
|
+
[CountryCodes.HongKong]: [{
|
|
8199
|
+
id: "proofOfIdentityCard",
|
|
8200
|
+
name: "stateIssuedProofOfIdentityCard"
|
|
8201
|
+
}, {
|
|
8202
|
+
id: "driversLicense",
|
|
8203
|
+
name: "driversLicense"
|
|
8204
|
+
}, {
|
|
8205
|
+
id: "passport",
|
|
8206
|
+
name: "passportNumber"
|
|
8207
|
+
}],
|
|
8208
|
+
[CountryCodes.Australia]: [{
|
|
8209
|
+
id: "driversLicense",
|
|
8210
|
+
name: "driversLicense"
|
|
8211
|
+
}, {
|
|
8212
|
+
id: "passport",
|
|
8213
|
+
name: "passportNumber"
|
|
8214
|
+
}]
|
|
8215
|
+
};
|
|
7888
8216
|
const taxIdNumberOptions = {
|
|
7889
8217
|
[CountryCodes.Denmark]: [{
|
|
7890
8218
|
id: "momsregistreringsnummerCVR",
|
|
@@ -7912,7 +8240,7 @@ const taxIdNumberOptions = {
|
|
|
7912
8240
|
name: "employerIdentificationNumber"
|
|
7913
8241
|
}, {
|
|
7914
8242
|
id: "ssn",
|
|
7915
|
-
name: "
|
|
8243
|
+
name: "socialSecurityNumber",
|
|
7916
8244
|
applicableOnlyFor: [CompanyTypesValue.SOLE_PROPRIETORSHIP]
|
|
7917
8245
|
}, {
|
|
7918
8246
|
id: "ssnLastFour",
|
|
@@ -7961,7 +8289,7 @@ function CompanyRegistrationNumberTypeSelector({
|
|
|
7961
8289
|
}
|
|
7962
8290
|
const inferCompanyRegistrationNumberType = (registrationNumber2, country2, companyType2) => {
|
|
7963
8291
|
const optionsForCountry = companyRegistrationNumberOptions[country2];
|
|
7964
|
-
const metadataFn = defaultFieldConfig$
|
|
8292
|
+
const metadataFn = defaultFieldConfig$8[country2];
|
|
7965
8293
|
if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function")
|
|
7966
8294
|
return void 0;
|
|
7967
8295
|
for (const option of optionsForCountry) {
|
|
@@ -7977,10 +8305,10 @@ const inferCompanyRegistrationNumberType = (registrationNumber2, country2, compa
|
|
|
7977
8305
|
}
|
|
7978
8306
|
}
|
|
7979
8307
|
};
|
|
7980
|
-
const defaultFieldMetadata$
|
|
8308
|
+
const defaultFieldMetadata$7 = {
|
|
7981
8309
|
label: "taxId"
|
|
7982
8310
|
};
|
|
7983
|
-
const defaultFieldConfig$
|
|
8311
|
+
const defaultFieldConfig$7 = {
|
|
7984
8312
|
[CountryCodes.Canada]: {
|
|
7985
8313
|
label: "businessNumber",
|
|
7986
8314
|
validators: validatePatternOnBlur(/^\d{9}$/),
|
|
@@ -8059,7 +8387,7 @@ const defaultFieldConfig$2 = {
|
|
|
8059
8387
|
switch (taxIdNumberType) {
|
|
8060
8388
|
case "ssn":
|
|
8061
8389
|
return {
|
|
8062
|
-
label: "
|
|
8390
|
+
label: "socialSecurityNumber",
|
|
8063
8391
|
validators: validatePatternOnBlur(/^\d{9}$/),
|
|
8064
8392
|
mask: {
|
|
8065
8393
|
mask: makeMask(...numericInputs(9))
|
|
@@ -8109,10 +8437,10 @@ const defaultFieldConfig$2 = {
|
|
|
8109
8437
|
validators: validatePatternOnBlur(/^\d{12}$/)
|
|
8110
8438
|
}
|
|
8111
8439
|
};
|
|
8112
|
-
const defaultFieldMetadata$
|
|
8440
|
+
const defaultFieldMetadata$6 = {
|
|
8113
8441
|
label: "vatNumber"
|
|
8114
8442
|
};
|
|
8115
|
-
const defaultFieldConfig$
|
|
8443
|
+
const defaultFieldConfig$6 = {
|
|
8116
8444
|
[CountryCodes.Austria]: {
|
|
8117
8445
|
label: "UST-ID",
|
|
8118
8446
|
validators: validatePatternOnBlur(/^ATU\d{8}$/),
|
|
@@ -8741,7 +9069,7 @@ const defaultFieldConfig$1 = {
|
|
|
8741
9069
|
};
|
|
8742
9070
|
const inferTaxIdNumberType = (taxId2, country2) => {
|
|
8743
9071
|
const optionsForCountry = taxIdNumberOptions[country2];
|
|
8744
|
-
const metadataFn = defaultFieldConfig$
|
|
9072
|
+
const metadataFn = defaultFieldConfig$6[country2] ?? defaultFieldConfig$7[country2];
|
|
8745
9073
|
if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function")
|
|
8746
9074
|
return void 0;
|
|
8747
9075
|
for (const option of optionsForCountry) {
|
|
@@ -8797,11 +9125,11 @@ function TaxId(props) {
|
|
|
8797
9125
|
fieldValidationErrors,
|
|
8798
9126
|
dataStoreId,
|
|
8799
9127
|
taxIdNumberType,
|
|
8800
|
-
fieldConfig = defaultFieldConfig$
|
|
9128
|
+
fieldConfig = defaultFieldConfig$7
|
|
8801
9129
|
} = props;
|
|
8802
9130
|
const metadata = resolveFieldMetadata(fieldConfig[country2], {
|
|
8803
9131
|
taxIdNumberType
|
|
8804
|
-
}, defaultFieldMetadata$
|
|
9132
|
+
}, defaultFieldMetadata$7);
|
|
8805
9133
|
const mergedProps = mergeFieldMetadataIntoProps("taxId", metadata, props);
|
|
8806
9134
|
const {
|
|
8807
9135
|
i18n
|
|
@@ -8916,12 +9244,12 @@ function VatNumber(props) {
|
|
|
8916
9244
|
country: country2,
|
|
8917
9245
|
fieldValidationErrors,
|
|
8918
9246
|
dataStoreId,
|
|
8919
|
-
fieldConfig = defaultFieldConfig$
|
|
9247
|
+
fieldConfig = defaultFieldConfig$6,
|
|
8920
9248
|
vatNumberType
|
|
8921
9249
|
} = props;
|
|
8922
9250
|
const metadata = resolveFieldMetadata(fieldConfig[country2], {
|
|
8923
9251
|
vatNumberType
|
|
8924
|
-
}, defaultFieldMetadata$
|
|
9252
|
+
}, defaultFieldMetadata$6);
|
|
8925
9253
|
const mergedProps = mergeFieldMetadataIntoProps("vatNumber", metadata, props);
|
|
8926
9254
|
const {
|
|
8927
9255
|
i18n
|
|
@@ -11329,19 +11657,6 @@ function FieldContainer(props) {
|
|
|
11329
11657
|
}
|
|
11330
11658
|
return renderField(fieldName);
|
|
11331
11659
|
}
|
|
11332
|
-
function useIsElementVisible(element) {
|
|
11333
|
-
const [isIntersecting, setIntersecting] = useState(false);
|
|
11334
|
-
useEffect(() => {
|
|
11335
|
-
if (element) {
|
|
11336
|
-
const observer = new IntersectionObserver(([entry]) => setIntersecting(entry.isIntersecting));
|
|
11337
|
-
observer.observe(element);
|
|
11338
|
-
return () => {
|
|
11339
|
-
observer.disconnect();
|
|
11340
|
-
};
|
|
11341
|
-
}
|
|
11342
|
-
}, [element]);
|
|
11343
|
-
return isIntersecting;
|
|
11344
|
-
}
|
|
11345
11660
|
const logger$n = createLogger("SearchAddress");
|
|
11346
11661
|
const SearchAddress = ({
|
|
11347
11662
|
data,
|
|
@@ -11362,7 +11677,7 @@ const SearchAddress = ({
|
|
|
11362
11677
|
const [searchText, setSearchText] = useState(null);
|
|
11363
11678
|
const [showSearchList, setShowSearchList] = useState(false);
|
|
11364
11679
|
const searchBoxRef = useRef(null);
|
|
11365
|
-
const isVisible = useIsElementVisible(searchBoxRef
|
|
11680
|
+
const isVisible = useIsElementVisible(searchBoxRef);
|
|
11366
11681
|
const canAutoFillKompanyAddress = kompanyAddress && searchText !== kompanyAddress && addressType === "registrationAddress";
|
|
11367
11682
|
useEffect(() => {
|
|
11368
11683
|
setSearchText(kompanyAddress);
|
|
@@ -11917,7 +12232,7 @@ function Address(props) {
|
|
|
11917
12232
|
formatters: addressFormatters,
|
|
11918
12233
|
rules: rules2,
|
|
11919
12234
|
fieldProblems: fieldValidationErrorsProp,
|
|
11920
|
-
|
|
12235
|
+
obscuredFields: []
|
|
11921
12236
|
});
|
|
11922
12237
|
const formUtils = formUtilities({
|
|
11923
12238
|
...props,
|
|
@@ -12070,12 +12385,12 @@ function Address(props) {
|
|
|
12070
12385
|
addressType,
|
|
12071
12386
|
kompanyAddress
|
|
12072
12387
|
}), jsxs("div", {
|
|
12073
|
-
className: "adyen-kyc-search-address--
|
|
12388
|
+
className: "adyen-kyc-search-address--below",
|
|
12074
12389
|
children: [jsxs("span", {
|
|
12075
|
-
className: "adyen-kyc-search-address--location
|
|
12390
|
+
className: "adyen-kyc-search-address--below-location",
|
|
12076
12391
|
children: [jsx(Icon, {
|
|
12077
12392
|
name: "location"
|
|
12078
|
-
}),
|
|
12393
|
+
}), datasetUtils.getCountryName(dataProp.country)]
|
|
12079
12394
|
}), showAddAddressButton && jsx(Button, {
|
|
12080
12395
|
showAsLink: true,
|
|
12081
12396
|
testId: "addAddressManuallyBtn",
|
|
@@ -12161,7 +12476,7 @@ function RegistrationAddressComponent(props) {
|
|
|
12161
12476
|
schema: ["operationalAddressIsSame"],
|
|
12162
12477
|
defaultData: data,
|
|
12163
12478
|
rules: validators || registrationAddressValidationRules,
|
|
12164
|
-
|
|
12479
|
+
obscuredFields: [],
|
|
12165
12480
|
optionalFields
|
|
12166
12481
|
});
|
|
12167
12482
|
const formUtils = formUtilities(props, i18n);
|
|
@@ -12782,7 +13097,7 @@ function isTransferInstrument(account) {
|
|
|
12782
13097
|
return account.bankAccount !== void 0;
|
|
12783
13098
|
}
|
|
12784
13099
|
const isInstantVerifiedAccount = (account) => Boolean(isTransferInstrument(account) ? account.bankAccount.trustedSource : account.trustedSource);
|
|
12785
|
-
const
|
|
13100
|
+
const getObscuredAccountNumber = ({
|
|
12786
13101
|
accountIdentifier,
|
|
12787
13102
|
realLastFour
|
|
12788
13103
|
}) => realLastFour ? `*******${realLastFour}` : accountIdentifier;
|
|
@@ -12950,55 +13265,6 @@ const updateTaxInformation = ({
|
|
|
12950
13265
|
}
|
|
12951
13266
|
return updatedEntity;
|
|
12952
13267
|
};
|
|
12953
|
-
function cleanNonNumbers(value) {
|
|
12954
|
-
return value.replace(/[^0-9]/g, "").trim();
|
|
12955
|
-
}
|
|
12956
|
-
function maskCPF(value) {
|
|
12957
|
-
return value.replace(/\W/gi, "").replace(/(\d{3})(?!$)/g, "$1.").replace(/(.{11}).(\d{1,2})$/g, "$1-$2");
|
|
12958
|
-
}
|
|
12959
|
-
function maskCNPJ(value) {
|
|
12960
|
-
return value.replace(/^(\d{2})(\d{3})(\d{3})?(\d{4})?(\d{1,2})?$/g, (match, g1, g2, g3, g4 = "", g5 = "") => `${g1}.${g2}.${g3}/${g4}${g5.length ? `-${g5}` : ""}`);
|
|
12961
|
-
}
|
|
12962
|
-
function formatBrazilSSN(value) {
|
|
12963
|
-
if (!value || typeof value !== "string")
|
|
12964
|
-
return "";
|
|
12965
|
-
const cleanValue = cleanNonNumbers(value);
|
|
12966
|
-
const formattedValue = cleanValue.length > 11 ? maskCNPJ(cleanValue) : maskCPF(cleanValue);
|
|
12967
|
-
return formattedValue;
|
|
12968
|
-
}
|
|
12969
|
-
function formatDenmarkCPR(value) {
|
|
12970
|
-
if (!value || typeof value !== "string")
|
|
12971
|
-
return "";
|
|
12972
|
-
const cleanValue = cleanNonNumbers(value);
|
|
12973
|
-
return cleanValue.replace(/^(\d{6})(\d{4})/g, (match, g1, g2) => `${g1}-${g2}`);
|
|
12974
|
-
}
|
|
12975
|
-
function formatSwedenPersonnummer(value) {
|
|
12976
|
-
if (!value || typeof value !== "string")
|
|
12977
|
-
return "";
|
|
12978
|
-
const cleanValue = cleanNonNumbers(value);
|
|
12979
|
-
if (cleanValue.length > 10) {
|
|
12980
|
-
return cleanValue.replace(/^(\d{8})(\d{4})$/g, (match, g1, g2) => `${g1}-${g2}`);
|
|
12981
|
-
}
|
|
12982
|
-
return cleanValue.replace(/^(\d{6})(\d{4})/g, (match, g1, g2) => `${g1}-${g2}`);
|
|
12983
|
-
}
|
|
12984
|
-
const validatePerIdNumberType = (input, idNumberType, fallbackCountryCode = null) => {
|
|
12985
|
-
var _a, _b;
|
|
12986
|
-
const countryCode = fallbackCountryCode || ((input || "").toUpperCase().match(/^[A-Z]{2}/) || [])[0];
|
|
12987
|
-
if (!input || !hasText(input) || input.length < 3) {
|
|
12988
|
-
return false;
|
|
12989
|
-
}
|
|
12990
|
-
if (countryCode in customPatternsPerIdNumberType) {
|
|
12991
|
-
return input ? !!((_b = (_a = customPatternsPerIdNumberType == null ? void 0 : customPatternsPerIdNumberType[countryCode]) == null ? void 0 : _a[idNumberType]) == null ? void 0 : _b.test(input)) : false;
|
|
12992
|
-
}
|
|
12993
|
-
return false;
|
|
12994
|
-
};
|
|
12995
|
-
const formattedCountries = [CountryCodes.Denmark, CountryCodes.Sweden];
|
|
12996
|
-
const stripCountryIdFormat = (value, country2) => {
|
|
12997
|
-
if (value && formattedCountries.includes(country2)) {
|
|
12998
|
-
return cleanNonNumbers(value);
|
|
12999
|
-
}
|
|
13000
|
-
return value;
|
|
13001
|
-
};
|
|
13002
13268
|
const mandatoryApiFields = {
|
|
13003
13269
|
INDIVIDUAL: ["personalDetails.firstName", "personalDetails.lastName", "personalDetails.residencyCountry"],
|
|
13004
13270
|
DECISIONMAKER: ["personalDetails.firstName", "personalDetails.lastName", "personalDetails.residencyCountry", "personalDetails.role", "personalDetails.jobTitle"],
|
|
@@ -13007,7 +13273,7 @@ const mandatoryApiFields = {
|
|
|
13007
13273
|
SOLE_PROPRIETORSHIP: ["solePropNameAndCountry.legalCompanyName", "solePropNameAndCountry.country"],
|
|
13008
13274
|
TRUST: ["trustRegistrationDetails.legalName", "trustRegistrationDetails.country"]
|
|
13009
13275
|
};
|
|
13010
|
-
const
|
|
13276
|
+
const individualObscuredFields = ["personalDetails.idNumber", "personalDetails.idNumberExempt"];
|
|
13011
13277
|
const individualBaseMapping = {
|
|
13012
13278
|
"personalDetails.firstName": "individual.name.firstName",
|
|
13013
13279
|
"personalDetails.lastName": "individual.name.lastName",
|
|
@@ -13307,7 +13573,7 @@ const adjustIdentificationData = (data, apiData) => {
|
|
|
13307
13573
|
} = data;
|
|
13308
13574
|
const identificationData = {
|
|
13309
13575
|
...apiData,
|
|
13310
|
-
number:
|
|
13576
|
+
number: idNumber2,
|
|
13311
13577
|
type: getIdentityTypeToApiIdentityTypeMap(data)[typeOfIdentity2] ?? "nationalIdNumber"
|
|
13312
13578
|
};
|
|
13313
13579
|
switch (typeOfIdentity2) {
|
|
@@ -15277,273 +15543,463 @@ const ContactDetailsComp = memo(ContactDetailsComponent, (prevProps, nextProps)
|
|
|
15277
15543
|
ContactDetailsComponent.defaultProps = {
|
|
15278
15544
|
data: {}
|
|
15279
15545
|
};
|
|
15280
|
-
const IdentityNumber
|
|
15281
|
-
const
|
|
15282
|
-
|
|
15283
|
-
|
|
15284
|
-
|
|
15285
|
-
3: 7,
|
|
15286
|
-
4: 9,
|
|
15287
|
-
5: 13,
|
|
15288
|
-
6: 15,
|
|
15289
|
-
7: 17,
|
|
15290
|
-
8: 19,
|
|
15291
|
-
9: 21,
|
|
15292
|
-
A: 1,
|
|
15293
|
-
B: 0,
|
|
15294
|
-
C: 5,
|
|
15295
|
-
D: 7,
|
|
15296
|
-
E: 9,
|
|
15297
|
-
F: 13,
|
|
15298
|
-
G: 15,
|
|
15299
|
-
H: 17,
|
|
15300
|
-
I: 19,
|
|
15301
|
-
J: 21,
|
|
15302
|
-
K: 2,
|
|
15303
|
-
L: 4,
|
|
15304
|
-
M: 18,
|
|
15305
|
-
N: 20,
|
|
15306
|
-
O: 11,
|
|
15307
|
-
P: 3,
|
|
15308
|
-
Q: 6,
|
|
15309
|
-
R: 8,
|
|
15310
|
-
S: 12,
|
|
15311
|
-
T: 14,
|
|
15312
|
-
U: 16,
|
|
15313
|
-
V: 10,
|
|
15314
|
-
W: 22,
|
|
15315
|
-
X: 25,
|
|
15316
|
-
Y: 24,
|
|
15317
|
-
Z: 23
|
|
15318
|
-
};
|
|
15319
|
-
const CHECKCHARACTER_EVEN_VALUE = {
|
|
15320
|
-
0: 0,
|
|
15321
|
-
1: 1,
|
|
15322
|
-
2: 2,
|
|
15323
|
-
3: 3,
|
|
15324
|
-
4: 4,
|
|
15325
|
-
5: 5,
|
|
15326
|
-
6: 6,
|
|
15327
|
-
7: 7,
|
|
15328
|
-
8: 8,
|
|
15329
|
-
9: 9,
|
|
15330
|
-
A: 0,
|
|
15331
|
-
B: 1,
|
|
15332
|
-
C: 2,
|
|
15333
|
-
D: 3,
|
|
15334
|
-
E: 4,
|
|
15335
|
-
F: 5,
|
|
15336
|
-
G: 6,
|
|
15337
|
-
H: 7,
|
|
15338
|
-
I: 8,
|
|
15339
|
-
J: 9,
|
|
15340
|
-
K: 10,
|
|
15341
|
-
L: 11,
|
|
15342
|
-
M: 12,
|
|
15343
|
-
N: 13,
|
|
15344
|
-
O: 14,
|
|
15345
|
-
P: 15,
|
|
15346
|
-
Q: 16,
|
|
15347
|
-
R: 17,
|
|
15348
|
-
S: 18,
|
|
15349
|
-
T: 19,
|
|
15350
|
-
U: 20,
|
|
15351
|
-
V: 21,
|
|
15352
|
-
W: 22,
|
|
15353
|
-
X: 23,
|
|
15354
|
-
Y: 24,
|
|
15355
|
-
Z: 25
|
|
15356
|
-
};
|
|
15357
|
-
function validCheckCharacter(input, calculationInput) {
|
|
15358
|
-
if (!/^[A-Z]$/.test(input)) {
|
|
15359
|
-
return false;
|
|
15360
|
-
}
|
|
15361
|
-
let total = 0;
|
|
15362
|
-
for (let i = 0; i < 15; i += 1) {
|
|
15363
|
-
const set = i % 2 === 1 ? CHECKCHARACTER_EVEN_VALUE : CHECKCHARACTER_ODD_VALUE;
|
|
15364
|
-
const token = calculationInput.substring(i, i + 1);
|
|
15365
|
-
const value = set[token];
|
|
15366
|
-
if (value == null) {
|
|
15367
|
-
return true;
|
|
15368
|
-
}
|
|
15369
|
-
total = (total + value) % 26;
|
|
15370
|
-
}
|
|
15371
|
-
return total >= 0 && total <= 26 && "ABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(total) === input;
|
|
15372
|
-
}
|
|
15373
|
-
const createErrorMessageObject = (format, idType) => ({
|
|
15374
|
-
key: "validationPleaseEnterAValidIdNumberWithFormat",
|
|
15375
|
-
values: {
|
|
15376
|
-
format,
|
|
15377
|
-
idType
|
|
15378
|
-
}
|
|
15379
|
-
});
|
|
15380
|
-
const countryIdNumberFormatters = {
|
|
15546
|
+
const IdentityNumber = "";
|
|
15547
|
+
const defaultFieldMetadata$5 = {
|
|
15548
|
+
label: "idNumber"
|
|
15549
|
+
};
|
|
15550
|
+
const defaultFieldConfig$5 = {
|
|
15381
15551
|
[CountryCodes.Brazil]: {
|
|
15382
|
-
|
|
15383
|
-
|
|
15384
|
-
|
|
15385
|
-
}
|
|
15386
|
-
|
|
15387
|
-
|
|
15388
|
-
|
|
15389
|
-
|
|
15390
|
-
|
|
15391
|
-
|
|
15392
|
-
|
|
15393
|
-
[CountryCodes.Sweden]: {
|
|
15394
|
-
idNumber: {
|
|
15395
|
-
formatter: formatSwedenPersonnummer,
|
|
15396
|
-
maxlength: 13
|
|
15552
|
+
label: "cadastroDePessoasFisicas",
|
|
15553
|
+
mask: {
|
|
15554
|
+
mask: makeMask(...numericInputs(3), ...nonInputs(" . "), ...numericInputs(3), ...nonInputs(" . "), ...numericInputs(3), ...nonInputs(" - "), ...numericInputs(2))
|
|
15555
|
+
},
|
|
15556
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Brazil]),
|
|
15557
|
+
guidanceText: {
|
|
15558
|
+
key: "enterNDigitsForExample",
|
|
15559
|
+
values: {
|
|
15560
|
+
numDigits: "11",
|
|
15561
|
+
example: "231.002.999-00"
|
|
15562
|
+
}
|
|
15397
15563
|
}
|
|
15398
15564
|
},
|
|
15399
|
-
[CountryCodes.
|
|
15400
|
-
|
|
15401
|
-
|
|
15565
|
+
[CountryCodes.Canada]: {
|
|
15566
|
+
label: "socialInsuranceNumber",
|
|
15567
|
+
mask: {
|
|
15568
|
+
mask: makeMask(...numericInputs(3), spacer, ...numericInputs(3), spacer, ...numericInputs(3))
|
|
15569
|
+
},
|
|
15570
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Canada]),
|
|
15571
|
+
guidanceText: {
|
|
15572
|
+
key: "enterNDigitsForExample",
|
|
15573
|
+
values: {
|
|
15574
|
+
numDigits: "9",
|
|
15575
|
+
example: "046 454 286"
|
|
15576
|
+
}
|
|
15402
15577
|
}
|
|
15403
15578
|
},
|
|
15404
|
-
|
|
15405
|
-
|
|
15406
|
-
|
|
15579
|
+
[CountryCodes.Croatia]: {
|
|
15580
|
+
label: "oib",
|
|
15581
|
+
mask: {
|
|
15582
|
+
mask: makeMask(...numericInputs(11))
|
|
15583
|
+
},
|
|
15584
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Croatia]),
|
|
15585
|
+
guidanceText: {
|
|
15586
|
+
key: "enterNDigitsForExample",
|
|
15587
|
+
values: {
|
|
15588
|
+
numDigits: "11",
|
|
15589
|
+
example: "94577403194"
|
|
15590
|
+
}
|
|
15407
15591
|
}
|
|
15408
|
-
}
|
|
15409
|
-
};
|
|
15410
|
-
const IdNumberValidationRules = {
|
|
15411
|
-
idNumber: [{
|
|
15412
|
-
validate: (value) => !!value,
|
|
15413
|
-
modes: ["blur"],
|
|
15414
|
-
errorMessage: "fieldIsRequired"
|
|
15415
|
-
}]
|
|
15416
|
-
};
|
|
15417
|
-
const countryIdNumberValidationRules = {
|
|
15418
|
-
[CountryCodes.Brazil]: {
|
|
15419
|
-
idNumber: [{
|
|
15420
|
-
validate: (idNumber2) => idNumber2 ? CountryIdNumberPatterns.BR.test(idNumber2) : false,
|
|
15421
|
-
modes: ["blur"],
|
|
15422
|
-
errorMessage: "invalidFormatIdentityNumberBR"
|
|
15423
|
-
}]
|
|
15424
|
-
},
|
|
15425
|
-
[CountryCodes.Canada]: {
|
|
15426
|
-
idNumber: [{
|
|
15427
|
-
validate: (idNumber2) => idNumber2 ? CountryIdNumberPatterns.CA.test(idNumber2) : false,
|
|
15428
|
-
modes: ["blur"],
|
|
15429
|
-
errorMessage: "invalidFormatIdentityNumberCA"
|
|
15430
|
-
}]
|
|
15431
15592
|
},
|
|
15432
15593
|
[CountryCodes.Denmark]: {
|
|
15433
|
-
|
|
15434
|
-
|
|
15435
|
-
|
|
15436
|
-
|
|
15437
|
-
|
|
15594
|
+
label: "detCentralePersonregister",
|
|
15595
|
+
mask: {
|
|
15596
|
+
mask: makeMask(...numericInputs(6), ...nonInputs(" - "), ...numericInputs(4))
|
|
15597
|
+
},
|
|
15598
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Denmark]),
|
|
15599
|
+
guidanceText: {
|
|
15600
|
+
key: "enterNDigitsForExample",
|
|
15601
|
+
values: {
|
|
15602
|
+
numDigits: "10",
|
|
15603
|
+
example: "010111-1113"
|
|
15604
|
+
}
|
|
15605
|
+
}
|
|
15438
15606
|
},
|
|
15439
15607
|
[CountryCodes.Italy]: {
|
|
15440
|
-
|
|
15441
|
-
|
|
15442
|
-
|
|
15443
|
-
|
|
15444
|
-
}
|
|
15608
|
+
label: "codiceFiscale",
|
|
15609
|
+
mask: {
|
|
15610
|
+
mask: makeMask(...alphaInputs(6), ...numericInputs(2), ...customInputs(1, /^[ABCDEHLMPRST]$/), ...numericInputs(2), ...alphaInputs(1), ...numericInputs(3), ...alphaInputs(1)),
|
|
15611
|
+
transformOnType: uppercase
|
|
15612
|
+
},
|
|
15613
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Italy]),
|
|
15614
|
+
guidanceText: {
|
|
15615
|
+
key: "enterNCharactersWithAMixForExample",
|
|
15616
|
+
values: {
|
|
15617
|
+
numChars: "16",
|
|
15618
|
+
example: "YULSQG40E60L271T"
|
|
15619
|
+
}
|
|
15620
|
+
}
|
|
15445
15621
|
},
|
|
15446
15622
|
[CountryCodes.Poland]: {
|
|
15447
|
-
|
|
15448
|
-
|
|
15449
|
-
|
|
15450
|
-
|
|
15451
|
-
|
|
15452
|
-
|
|
15453
|
-
|
|
15454
|
-
|
|
15455
|
-
|
|
15456
|
-
|
|
15457
|
-
|
|
15458
|
-
}
|
|
15459
|
-
},
|
|
15460
|
-
[CountryCodes.Singapore]: {
|
|
15461
|
-
idNumber: [{
|
|
15462
|
-
validate: (idNumber2) => idNumber2 ? CountryIdNumberPatterns.SG.test(idNumber2) : false,
|
|
15463
|
-
modes: ["blur"],
|
|
15464
|
-
errorMessage: "invalidFormatIdentityNumberSG"
|
|
15465
|
-
}]
|
|
15466
|
-
},
|
|
15467
|
-
[CountryCodes.Spain]: {
|
|
15468
|
-
idNumber: [{
|
|
15469
|
-
validate: (idNumber2) => idNumber2 ? CountryIdNumberPatterns.ES.test(idNumber2) : false,
|
|
15470
|
-
modes: ["blur"],
|
|
15471
|
-
errorMessage: "invalidFormatIdentityNumberES"
|
|
15472
|
-
}]
|
|
15623
|
+
label: "peselNumber",
|
|
15624
|
+
mask: {
|
|
15625
|
+
mask: makeMask(...numericInputs(11))
|
|
15626
|
+
},
|
|
15627
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Poland]),
|
|
15628
|
+
guidanceText: {
|
|
15629
|
+
key: "enterNDigitsForExample",
|
|
15630
|
+
values: {
|
|
15631
|
+
numDigits: "11",
|
|
15632
|
+
example: "23012224757"
|
|
15633
|
+
}
|
|
15634
|
+
}
|
|
15473
15635
|
},
|
|
15474
|
-
[CountryCodes.
|
|
15475
|
-
|
|
15476
|
-
|
|
15477
|
-
|
|
15478
|
-
|
|
15479
|
-
|
|
15636
|
+
[CountryCodes.PuertoRico]: ({
|
|
15637
|
+
idNumberType
|
|
15638
|
+
}) => {
|
|
15639
|
+
switch (idNumberType) {
|
|
15640
|
+
case "ssn":
|
|
15641
|
+
return {
|
|
15642
|
+
label: "socialSecurityNumber",
|
|
15643
|
+
mask: {
|
|
15644
|
+
mask: makeMask(...numericInputs(3), ...nonInputs(" - "), ...numericInputs(2), ...nonInputs(" - "), ...numericInputs(4))
|
|
15645
|
+
},
|
|
15646
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.UnitedStates].ssn),
|
|
15647
|
+
guidanceText: {
|
|
15648
|
+
key: "enterNDigitsForExample",
|
|
15649
|
+
values: {
|
|
15650
|
+
numDigits: "9",
|
|
15651
|
+
example: "123-12-1234"
|
|
15652
|
+
}
|
|
15653
|
+
}
|
|
15654
|
+
};
|
|
15655
|
+
case "ssnLastFour":
|
|
15656
|
+
default:
|
|
15657
|
+
return {
|
|
15658
|
+
label: "socialSecurityNumber",
|
|
15659
|
+
mask: {
|
|
15660
|
+
mask: makeMask(...nonInputs("***"), ...nonInputs(" - "), ...nonInputs("**"), ...nonInputs(" - "), ...numericInputs(4))
|
|
15661
|
+
},
|
|
15662
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.UnitedStates].ssnLastFour),
|
|
15663
|
+
guidanceText: {
|
|
15664
|
+
key: "enterLastNDigitsForExample",
|
|
15665
|
+
values: {
|
|
15666
|
+
numDigits: "4",
|
|
15667
|
+
example: "***-**-1234"
|
|
15668
|
+
}
|
|
15669
|
+
}
|
|
15670
|
+
};
|
|
15671
|
+
}
|
|
15480
15672
|
},
|
|
15481
|
-
[CountryCodes.
|
|
15482
|
-
|
|
15483
|
-
|
|
15484
|
-
|
|
15485
|
-
|
|
15486
|
-
|
|
15673
|
+
[CountryCodes.Romania]: {
|
|
15674
|
+
label: "codNumericPersonal",
|
|
15675
|
+
mask: {
|
|
15676
|
+
mask: makeMask(...numericInputs(13))
|
|
15677
|
+
},
|
|
15678
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Romania]),
|
|
15679
|
+
guidanceText: {
|
|
15680
|
+
key: "enterNDigitsForExample",
|
|
15681
|
+
values: {
|
|
15682
|
+
numDigits: "13",
|
|
15683
|
+
example: "8001011234567"
|
|
15684
|
+
}
|
|
15685
|
+
}
|
|
15487
15686
|
},
|
|
15488
|
-
|
|
15489
|
-
|
|
15490
|
-
|
|
15491
|
-
|
|
15492
|
-
|
|
15493
|
-
}
|
|
15687
|
+
[CountryCodes.Singapore]: {
|
|
15688
|
+
label: "nric",
|
|
15689
|
+
mask: {
|
|
15690
|
+
mask: makeMask(...alphaInputs(1), ...numericInputs(6), ...alphaInputs(1)),
|
|
15691
|
+
transformOnType: uppercase
|
|
15692
|
+
},
|
|
15693
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Singapore]),
|
|
15694
|
+
guidanceText: {
|
|
15695
|
+
key: "enterNCharactersWithAMixForExample",
|
|
15696
|
+
values: {
|
|
15697
|
+
numChars: "8",
|
|
15698
|
+
example: "T0123456J"
|
|
15699
|
+
}
|
|
15700
|
+
}
|
|
15701
|
+
},
|
|
15702
|
+
[CountryCodes.Spain]: ({
|
|
15703
|
+
idNumberType
|
|
15704
|
+
}) => {
|
|
15705
|
+
switch (idNumberType) {
|
|
15706
|
+
case "dni":
|
|
15707
|
+
return {
|
|
15708
|
+
label: "dni",
|
|
15709
|
+
mask: {
|
|
15710
|
+
mask: makeMask(...customInputs(1, /^[KL]$/, true), ...numericInputs(8), ...alphaInputs(1)),
|
|
15711
|
+
transformOnType: uppercase
|
|
15712
|
+
},
|
|
15713
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Spain].dni),
|
|
15714
|
+
guidanceText: {
|
|
15715
|
+
key: "enterXToYCharactersWithAMixForExample",
|
|
15716
|
+
values: {
|
|
15717
|
+
minChars: "9",
|
|
15718
|
+
maxChars: "10",
|
|
15719
|
+
example: "12345678A or L12345678A"
|
|
15720
|
+
}
|
|
15721
|
+
}
|
|
15722
|
+
};
|
|
15723
|
+
case "nie":
|
|
15724
|
+
default:
|
|
15725
|
+
return {
|
|
15726
|
+
label: "nie",
|
|
15727
|
+
mask: {
|
|
15728
|
+
mask: makeMask(...customInputs(1, /^[MXYZ]$/), ...numericInputs(7), ...numericInputs(1, true), ...alphaInputs(1)),
|
|
15729
|
+
transformOnType: uppercase
|
|
15730
|
+
},
|
|
15731
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Spain].nie),
|
|
15732
|
+
guidanceText: {
|
|
15733
|
+
key: "enterXToYCharactersWithAMixForExample",
|
|
15734
|
+
values: {
|
|
15735
|
+
minChars: "9",
|
|
15736
|
+
maxChars: "10",
|
|
15737
|
+
example: "X12345678A or Z6527153N"
|
|
15738
|
+
}
|
|
15739
|
+
}
|
|
15740
|
+
};
|
|
15741
|
+
}
|
|
15742
|
+
},
|
|
15743
|
+
[CountryCodes.Sweden]: {
|
|
15744
|
+
label: "personnummer",
|
|
15745
|
+
mask: {
|
|
15746
|
+
mask: makeMask(...numericInputs(6), ...numericInputs(2, true), ...nonInputs(" - "), ...numericInputs(4))
|
|
15747
|
+
},
|
|
15748
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Sweden]),
|
|
15749
|
+
guidanceText: {
|
|
15750
|
+
key: "enterXOrYDigitsForExample",
|
|
15751
|
+
values: {
|
|
15752
|
+
xDigits: "10",
|
|
15753
|
+
yDigits: "12",
|
|
15754
|
+
example: "640823-3234 or 19640823-3234"
|
|
15755
|
+
}
|
|
15756
|
+
}
|
|
15757
|
+
},
|
|
15758
|
+
[CountryCodes.UnitedStates]: ({
|
|
15759
|
+
idNumberType
|
|
15760
|
+
}) => {
|
|
15761
|
+
switch (idNumberType) {
|
|
15762
|
+
case "ssn":
|
|
15763
|
+
return {
|
|
15764
|
+
label: "socialSecurityNumber",
|
|
15765
|
+
mask: {
|
|
15766
|
+
mask: makeMask(...numericInputs(3), ...nonInputs(" - "), ...numericInputs(2), ...nonInputs(" - "), ...numericInputs(4))
|
|
15767
|
+
},
|
|
15768
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.UnitedStates].ssn),
|
|
15769
|
+
guidanceText: {
|
|
15770
|
+
key: "enterNDigitsForExample",
|
|
15771
|
+
values: {
|
|
15772
|
+
numDigits: "9",
|
|
15773
|
+
example: "123-12-1234"
|
|
15774
|
+
}
|
|
15775
|
+
}
|
|
15776
|
+
};
|
|
15777
|
+
case "ssnLastFour":
|
|
15778
|
+
default:
|
|
15779
|
+
return {
|
|
15780
|
+
label: "socialSecurityNumber",
|
|
15781
|
+
mask: {
|
|
15782
|
+
mask: makeMask(...nonInputs("***"), ...nonInputs(" - "), ...nonInputs("**"), ...nonInputs(" - "), ...numericInputs(4))
|
|
15783
|
+
},
|
|
15784
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.UnitedStates].ssnLastFour),
|
|
15785
|
+
guidanceText: {
|
|
15786
|
+
key: "enterLastNDigitsForExample",
|
|
15787
|
+
values: {
|
|
15788
|
+
numDigits: "4",
|
|
15789
|
+
example: "***-**-1234"
|
|
15790
|
+
}
|
|
15791
|
+
}
|
|
15792
|
+
};
|
|
15793
|
+
}
|
|
15794
|
+
},
|
|
15795
|
+
[CountryCodes.NewZealand]: ({
|
|
15796
|
+
idNumberType
|
|
15797
|
+
}) => {
|
|
15798
|
+
switch (idNumberType) {
|
|
15799
|
+
case "passport":
|
|
15800
|
+
return {
|
|
15801
|
+
label: "passportNumber",
|
|
15802
|
+
mask: {
|
|
15803
|
+
mask: makeMask(...alphaInputs(2), ...numericInputs(6), ...numericInputs(1, true)),
|
|
15804
|
+
transformOnType: uppercase
|
|
15805
|
+
},
|
|
15806
|
+
validators: validatePatternOnBlur(PassportNumberPatterns[CountryCodes.NewZealand]),
|
|
15807
|
+
guidanceText: {
|
|
15808
|
+
key: "enterXToYCharactersWithAMixForExample",
|
|
15809
|
+
values: {
|
|
15810
|
+
minChars: "8",
|
|
15811
|
+
maxChars: "9",
|
|
15812
|
+
example: "RA000750"
|
|
15813
|
+
}
|
|
15814
|
+
}
|
|
15815
|
+
};
|
|
15816
|
+
case "driversLicense":
|
|
15817
|
+
default:
|
|
15818
|
+
return {
|
|
15819
|
+
label: "driversLicense",
|
|
15820
|
+
mask: {
|
|
15821
|
+
mask: makeMask(...alphaInputs(2), ...numericInputs(6)),
|
|
15822
|
+
transformOnType: uppercase
|
|
15823
|
+
},
|
|
15824
|
+
validators: validatePatternOnBlur(DriversLicenseNumberPatterns[CountryCodes.NewZealand]),
|
|
15825
|
+
guidanceText: {
|
|
15826
|
+
key: "enterNCharactersWithAMixForExample",
|
|
15827
|
+
values: {
|
|
15828
|
+
numChars: "8",
|
|
15829
|
+
example: "KA111112"
|
|
15830
|
+
}
|
|
15831
|
+
}
|
|
15832
|
+
};
|
|
15833
|
+
}
|
|
15834
|
+
},
|
|
15835
|
+
[CountryCodes.HongKong]: ({
|
|
15836
|
+
idNumberType
|
|
15837
|
+
}) => {
|
|
15838
|
+
switch (idNumberType) {
|
|
15839
|
+
case "proofOfIdentityCard":
|
|
15840
|
+
return {
|
|
15841
|
+
label: "hkid",
|
|
15842
|
+
mask: {
|
|
15843
|
+
mask: makeMask(...alphaInputs(1), ...alphaInputs(1, true), ...numericInputs(6), ...nonInputs("("), ...customInputs(1, /^[0-9A]$/), ...nonInputs(")")),
|
|
15844
|
+
transformOnType: uppercase
|
|
15845
|
+
},
|
|
15846
|
+
validators: validatePatternOnBlur(ProofOfIdentityCardPatterns[CountryCodes.HongKong]),
|
|
15847
|
+
guidanceText: {
|
|
15848
|
+
key: "enterXToYCharactersWithAMixForExample",
|
|
15849
|
+
values: {
|
|
15850
|
+
minChars: "8",
|
|
15851
|
+
maxChars: "9",
|
|
15852
|
+
example: "Z683365(5) or AB123456(A)"
|
|
15853
|
+
}
|
|
15854
|
+
}
|
|
15855
|
+
};
|
|
15856
|
+
case "passport":
|
|
15857
|
+
return {
|
|
15858
|
+
label: "passportNumber",
|
|
15859
|
+
mask: {
|
|
15860
|
+
mask: makeMask(...alphaInputs(1), ...alphaInputs(1, true), ...numericInputs(6), ...alphanumericInputs(1), ...alphanumericInputs(1, true)),
|
|
15861
|
+
transformOnType: uppercase
|
|
15862
|
+
},
|
|
15863
|
+
validators: validatePatternOnBlur(PassportNumberPatterns[CountryCodes.HongKong]),
|
|
15864
|
+
guidanceText: {
|
|
15865
|
+
key: "enterXToYCharactersWithAMixForExample",
|
|
15866
|
+
values: {
|
|
15867
|
+
minChars: "8",
|
|
15868
|
+
maxChars: "10",
|
|
15869
|
+
example: "H12345678"
|
|
15870
|
+
}
|
|
15871
|
+
}
|
|
15872
|
+
};
|
|
15873
|
+
case "driversLicense":
|
|
15874
|
+
default:
|
|
15875
|
+
return {
|
|
15876
|
+
label: "driversLicense",
|
|
15877
|
+
mask: {
|
|
15878
|
+
mask: makeMask(...alphanumericInputs(7), spacer, ...alphanumericInputs(1))
|
|
15879
|
+
},
|
|
15880
|
+
validators: validatePatternOnBlur(DriversLicenseNumberPatterns[CountryCodes.HongKong]),
|
|
15881
|
+
guidanceText: {
|
|
15882
|
+
key: "enterNCharactersForExample",
|
|
15883
|
+
values: {
|
|
15884
|
+
numChars: "8",
|
|
15885
|
+
example: "A123452 0"
|
|
15886
|
+
}
|
|
15887
|
+
}
|
|
15888
|
+
};
|
|
15889
|
+
}
|
|
15890
|
+
},
|
|
15891
|
+
[CountryCodes.Australia]: ({
|
|
15892
|
+
idNumberType
|
|
15893
|
+
}) => {
|
|
15894
|
+
switch (idNumberType) {
|
|
15895
|
+
case "passport":
|
|
15896
|
+
return {
|
|
15897
|
+
label: "passportNumber",
|
|
15898
|
+
mask: {
|
|
15899
|
+
mask: makeMask(...alphaInputs(1), ...alphaInputs(1, true), ...numericInputs(7)),
|
|
15900
|
+
transformOnType: uppercase
|
|
15901
|
+
},
|
|
15902
|
+
validators: validatePatternOnBlur(PassportNumberPatterns[CountryCodes.Australia]),
|
|
15903
|
+
guidanceText: {
|
|
15904
|
+
key: "enterXToYCharactersWithAMixForExample",
|
|
15905
|
+
values: {
|
|
15906
|
+
minChars: "8",
|
|
15907
|
+
maxChars: "9",
|
|
15908
|
+
example: "RA0123456"
|
|
15909
|
+
}
|
|
15910
|
+
}
|
|
15911
|
+
};
|
|
15912
|
+
case "driversLicense":
|
|
15913
|
+
default:
|
|
15914
|
+
return {
|
|
15915
|
+
label: "driversLicense",
|
|
15916
|
+
mask: {
|
|
15917
|
+
mask: makeMask(...alphanumericInputs(6), ...alphanumericInputs(5, true)),
|
|
15918
|
+
transformOnType: uppercase
|
|
15919
|
+
},
|
|
15920
|
+
validators: validatePatternOnBlur(DriversLicenseNumberPatterns[CountryCodes.Australia]),
|
|
15921
|
+
guidanceText: {
|
|
15922
|
+
key: "enterXToYCharactersWithAMixForExample",
|
|
15923
|
+
values: {
|
|
15924
|
+
minChars: "6",
|
|
15925
|
+
maxChars: "11",
|
|
15926
|
+
example: "1314159 or GN7073"
|
|
15927
|
+
}
|
|
15928
|
+
}
|
|
15929
|
+
};
|
|
15930
|
+
}
|
|
15494
15931
|
}
|
|
15495
15932
|
};
|
|
15496
|
-
const
|
|
15497
|
-
|
|
15498
|
-
|
|
15499
|
-
|
|
15500
|
-
|
|
15501
|
-
|
|
15502
|
-
|
|
15503
|
-
|
|
15933
|
+
const licenseCardNumberDefaultMetadata = {
|
|
15934
|
+
label: "licenseCardNumber"
|
|
15935
|
+
};
|
|
15936
|
+
const licenseCardNumberDefaultConfig = {
|
|
15937
|
+
[CountryCodes.NewZealand]: {
|
|
15938
|
+
label: "licenceVersionNumber",
|
|
15939
|
+
mask: {
|
|
15940
|
+
mask: makeMask(...numericInputs(3))
|
|
15504
15941
|
},
|
|
15505
|
-
|
|
15506
|
-
|
|
15507
|
-
|
|
15508
|
-
|
|
15509
|
-
|
|
15510
|
-
|
|
15942
|
+
validators: validatePatternOnBlur(DriversLicenseCardNumberPatterns[CountryCodes.NewZealand]),
|
|
15943
|
+
guidanceText: {
|
|
15944
|
+
key: "enterNDigitsForExample",
|
|
15945
|
+
values: {
|
|
15946
|
+
numDigits: "3",
|
|
15947
|
+
example: "108"
|
|
15948
|
+
}
|
|
15949
|
+
}
|
|
15950
|
+
},
|
|
15951
|
+
[CountryCodes.Australia]: {
|
|
15952
|
+
label: "licenseCardNumber",
|
|
15953
|
+
mask: {
|
|
15954
|
+
mask: makeMask(...alphanumericInputs(6), ...alphanumericInputs(4, true)),
|
|
15955
|
+
transformOnType: uppercase
|
|
15956
|
+
},
|
|
15957
|
+
validators: validatePatternOnBlur(DriversLicenseCardNumberPatterns[CountryCodes.Australia]),
|
|
15958
|
+
guidanceText: {
|
|
15959
|
+
key: "enterXToYCharactersWithAMixForExample",
|
|
15960
|
+
values: {
|
|
15961
|
+
minChars: "6",
|
|
15962
|
+
maxChars: "10",
|
|
15963
|
+
example: "FCC3456789 or 1898442"
|
|
15964
|
+
}
|
|
15511
15965
|
}
|
|
15512
15966
|
}
|
|
15513
15967
|
};
|
|
15514
15968
|
const idNumberFields = ["idNumber", "idNumberExempt"];
|
|
15515
|
-
function
|
|
15969
|
+
function IdentityNumberComponent(props) {
|
|
15516
15970
|
const {
|
|
15517
15971
|
i18n
|
|
15518
15972
|
} = useI18nContext();
|
|
15519
15973
|
const {
|
|
15520
|
-
classNames,
|
|
15521
15974
|
country: country2,
|
|
15522
15975
|
data: propData = {},
|
|
15523
|
-
dataPlaceholder,
|
|
15524
15976
|
dataStoreId,
|
|
15525
15977
|
errors: propErrors,
|
|
15526
15978
|
fieldValidationErrors,
|
|
15527
|
-
idNumberType
|
|
15528
|
-
|
|
15529
|
-
requiredFields
|
|
15979
|
+
idNumberType,
|
|
15980
|
+
obscuredFields,
|
|
15981
|
+
requiredFields,
|
|
15982
|
+
fieldConfig: propFieldConfig,
|
|
15983
|
+
shouldValidate: propShouldValidate
|
|
15530
15984
|
} = props;
|
|
15531
15985
|
const stateRef = useRef({
|
|
15532
15986
|
setState: null
|
|
15533
15987
|
});
|
|
15534
|
-
const formUtils = formUtilities(props, i18n);
|
|
15535
15988
|
const [errors, setErrors] = useState(propErrors);
|
|
15536
15989
|
const [data, setData] = useState({
|
|
15537
15990
|
...propData,
|
|
15538
15991
|
idNumberExempt: !!(propData == null ? void 0 : propData.idNumberExempt)
|
|
15539
15992
|
});
|
|
15540
|
-
const
|
|
15541
|
-
const
|
|
15542
|
-
const
|
|
15543
|
-
|
|
15544
|
-
|
|
15545
|
-
|
|
15546
|
-
|
|
15993
|
+
const schema = requiredFields ?? idNumberFields;
|
|
15994
|
+
const fieldConfig = propFieldConfig ?? defaultFieldConfig$5;
|
|
15995
|
+
const metadata = resolveFieldMetadata(fieldConfig[country2], {
|
|
15996
|
+
idNumberType
|
|
15997
|
+
}, defaultFieldMetadata$5);
|
|
15998
|
+
const mergedProps = mergeFieldMetadataIntoProps("idNumber", metadata, {
|
|
15999
|
+
requiredFields: schema,
|
|
16000
|
+
obscuredFields
|
|
16001
|
+
});
|
|
16002
|
+
const formUtils = formUtilities(mergedProps, i18n);
|
|
15547
16003
|
const {
|
|
15548
16004
|
handleChangeFor,
|
|
15549
16005
|
data: formData,
|
|
@@ -15554,13 +16010,12 @@ function IdentityNumber(props) {
|
|
|
15554
16010
|
setErrors: setFormErrors,
|
|
15555
16011
|
triggerValidation
|
|
15556
16012
|
} = useForm({
|
|
15557
|
-
...
|
|
15558
|
-
schema
|
|
15559
|
-
formatters: formattingRules,
|
|
15560
|
-
rules: customRules || validationRules,
|
|
16013
|
+
...mergedProps,
|
|
16014
|
+
schema,
|
|
15561
16015
|
defaultData: propData,
|
|
16016
|
+
rules: mergedProps.validators,
|
|
15562
16017
|
fieldProblems: fieldValidationErrors,
|
|
15563
|
-
|
|
16018
|
+
obscuredFields
|
|
15564
16019
|
});
|
|
15565
16020
|
useEffect(() => {
|
|
15566
16021
|
if (propErrors && propErrors.idNumber) {
|
|
@@ -15619,37 +16074,30 @@ function IdentityNumber(props) {
|
|
|
15619
16074
|
}
|
|
15620
16075
|
});
|
|
15621
16076
|
}, [data, valid, errors, fieldProblems, dataStoreId]);
|
|
15622
|
-
const classModifiers = [formUtils.isRequiredField("idNumberExempt") ? "idNumberWithExempt" : "idNumber"];
|
|
15623
|
-
if (classNames)
|
|
15624
|
-
classModifiers.push(...classNames);
|
|
15625
16077
|
return jsx("div", {
|
|
15626
16078
|
className: "adyen-kyc-field__id-number",
|
|
15627
16079
|
children: formUtils.isRequiredField("idNumber") && jsxs(Fragment, {
|
|
15628
|
-
children: [jsx(
|
|
16080
|
+
children: [jsx(MaskedInputText, {
|
|
15629
16081
|
name: "idNumber",
|
|
15630
|
-
label: formUtils.getLabel("idNumber"),
|
|
15631
|
-
|
|
16082
|
+
label: formUtils.getLabel("idNumber", "idNumber"),
|
|
16083
|
+
formatGuidance: formUtils.getGuidanceText("idNumber"),
|
|
16084
|
+
classNameModifiers: {
|
|
16085
|
+
field: ["idNumber"],
|
|
16086
|
+
input: ["idNumber"]
|
|
16087
|
+
},
|
|
15632
16088
|
errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldProblems),
|
|
15633
|
-
|
|
16089
|
+
shouldValidate: propShouldValidate,
|
|
15634
16090
|
isValid: valid.idNumber,
|
|
15635
|
-
|
|
15636
|
-
|
|
15637
|
-
|
|
15638
|
-
|
|
15639
|
-
|
|
15640
|
-
|
|
15641
|
-
|
|
15642
|
-
|
|
15643
|
-
|
|
15644
|
-
|
|
15645
|
-
"aria-label": formUtils.getLabel("idNumber", "idNumber"),
|
|
15646
|
-
"aria-invalid": !valid.idNumber,
|
|
15647
|
-
inputMode: "numeric",
|
|
15648
|
-
maxLength: maxLengthForField,
|
|
15649
|
-
...data.idNumberExempt && {
|
|
15650
|
-
disabled: true
|
|
15651
|
-
}
|
|
15652
|
-
})
|
|
16091
|
+
"aria-required": formUtils.isRequiredField("idNumber"),
|
|
16092
|
+
"aria-label": formUtils.getLabel("idNumber"),
|
|
16093
|
+
"aria-invalid": !valid.idNumber,
|
|
16094
|
+
disabled: data.idNumberExempt,
|
|
16095
|
+
onBlur: handleChangeFor("idNumber", "blur"),
|
|
16096
|
+
readonly: formUtils.isReadOnly("idNumber"),
|
|
16097
|
+
value: data.idNumber ?? "",
|
|
16098
|
+
onInput: handleChangeFor("idNumber", "input"),
|
|
16099
|
+
acceptObscuredValue: formUtils == null ? void 0 : formUtils.isObscured("idNumber"),
|
|
16100
|
+
...formUtils.getMask("idNumber")
|
|
15653
16101
|
}), jsx(Field, {
|
|
15654
16102
|
classNameModifiers: ["idNumber__checkbox"],
|
|
15655
16103
|
name: "idNumberExempt",
|
|
@@ -15668,7 +16116,6 @@ function IdentityNumber(props) {
|
|
|
15668
16116
|
})
|
|
15669
16117
|
});
|
|
15670
16118
|
}
|
|
15671
|
-
const IdentityNumberComponent = memo(IdentityNumber, (prevProps, nextProps) => prevProps.country === nextProps.country && prevProps.shouldValidate === nextProps.shouldValidate && objectsDeepEqual(prevProps.errors, nextProps.errors) && objectsDeepEqual(prevProps.labels, nextProps.labels) && objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors));
|
|
15672
16119
|
const roleMetadata = {
|
|
15673
16120
|
[DecisionMakerType.CONTROLLING_PERSON]: {
|
|
15674
16121
|
name: "controllingPerson",
|
|
@@ -16057,12 +16504,8 @@ const personalDetailsValidationRules = {
|
|
|
16057
16504
|
errorMessage: "fieldIsRequired"
|
|
16058
16505
|
}
|
|
16059
16506
|
};
|
|
16060
|
-
const mapIdentityTypeToItem = (type, label) => ({
|
|
16061
|
-
id: type,
|
|
16062
|
-
name: label
|
|
16063
|
-
});
|
|
16064
16507
|
const TypeOfIdentity = ({
|
|
16065
|
-
|
|
16508
|
+
availableIdentityTypesOptions,
|
|
16066
16509
|
selectedIdentityType,
|
|
16067
16510
|
setSelectedIdentityType,
|
|
16068
16511
|
label,
|
|
@@ -16081,7 +16524,13 @@ const TypeOfIdentity = ({
|
|
|
16081
16524
|
children: (childProps) => jsx(Select, {
|
|
16082
16525
|
...childProps,
|
|
16083
16526
|
isInvalid: false,
|
|
16084
|
-
items:
|
|
16527
|
+
items: availableIdentityTypesOptions.map(({
|
|
16528
|
+
id: id2,
|
|
16529
|
+
name
|
|
16530
|
+
}) => ({
|
|
16531
|
+
id: id2,
|
|
16532
|
+
name: i18n.get(name)
|
|
16533
|
+
})),
|
|
16085
16534
|
placeholder: i18n.get("id"),
|
|
16086
16535
|
selected: selectedIdentityType,
|
|
16087
16536
|
onChange: (event) => setSelectedIdentityType(event.target.value)
|
|
@@ -16093,48 +16542,26 @@ const isTruthyValidator = {
|
|
|
16093
16542
|
modes: ["blur"],
|
|
16094
16543
|
errorMessage: "fieldIsRequired"
|
|
16095
16544
|
};
|
|
16545
|
+
const isNotEmptyValidator = {
|
|
16546
|
+
validate: (value) => !isEmpty(value),
|
|
16547
|
+
modes: ["blur"],
|
|
16548
|
+
errorMessage: "fieldIsRequired"
|
|
16549
|
+
};
|
|
16096
16550
|
const auIdentityValidationRules = {
|
|
16097
16551
|
typeOfIdentity: [isTruthyValidator],
|
|
16098
|
-
idNumber: [{
|
|
16099
|
-
validate: (value, context) => {
|
|
16100
|
-
switch (context == null ? void 0 : context.state.data.typeOfIdentity) {
|
|
16101
|
-
case "passport":
|
|
16102
|
-
return PassportNumberPatterns.AU.test(value ?? "");
|
|
16103
|
-
case "driversLicense":
|
|
16104
|
-
return DriversLicenseNumberPatterns.AU.test(value ?? "");
|
|
16105
|
-
default:
|
|
16106
|
-
return false;
|
|
16107
|
-
}
|
|
16108
|
-
},
|
|
16109
|
-
errorMessage: (_, context) => {
|
|
16110
|
-
switch (context == null ? void 0 : context.state.data.typeOfIdentity) {
|
|
16111
|
-
case "passport":
|
|
16112
|
-
return "invalidFormatForAuPassportNumber";
|
|
16113
|
-
case "driversLicense":
|
|
16114
|
-
return "invalidFormatForAuDriversLicenseNumber";
|
|
16115
|
-
}
|
|
16116
|
-
},
|
|
16117
|
-
modes: ["blur"]
|
|
16118
|
-
}],
|
|
16119
|
-
licenseCardNumber: [{
|
|
16120
|
-
validate: (value) => DriversLicenseNumberPatterns.AU.test(value ?? ""),
|
|
16121
|
-
errorMessage: "invalidFormatForAuDriversLicenseCardNumber",
|
|
16122
|
-
modes: ["blur"]
|
|
16123
|
-
}],
|
|
16124
16552
|
issuerState: [isTruthyValidator]
|
|
16125
16553
|
};
|
|
16126
|
-
const DriversLicense$
|
|
16554
|
+
const DriversLicense$1 = ({
|
|
16127
16555
|
driversLicense: driversLicense2,
|
|
16128
16556
|
onIssuerStateChange,
|
|
16129
16557
|
onLicenseNumberInput,
|
|
16130
16558
|
onLicenseNumberBlur,
|
|
16131
16559
|
onCardNumberInput,
|
|
16132
16560
|
onCardNumberBlur,
|
|
16133
|
-
formUtils
|
|
16134
|
-
getLabel
|
|
16135
|
-
},
|
|
16561
|
+
formUtils,
|
|
16136
16562
|
isValid,
|
|
16137
|
-
errorMessages
|
|
16563
|
+
errorMessages,
|
|
16564
|
+
shouldValidate
|
|
16138
16565
|
}) => {
|
|
16139
16566
|
const {
|
|
16140
16567
|
i18n
|
|
@@ -16145,7 +16572,7 @@ const DriversLicense$2 = ({
|
|
|
16145
16572
|
return jsxs(Fragment, {
|
|
16146
16573
|
children: [jsx(Field, {
|
|
16147
16574
|
name: "issuerState",
|
|
16148
|
-
label: getLabel("issuerState"),
|
|
16575
|
+
label: formUtils.getLabel("issuerState"),
|
|
16149
16576
|
isValid: isValid.issuerState,
|
|
16150
16577
|
errorMessage: errorMessages.issuerState,
|
|
16151
16578
|
children: (childProps) => jsx(Select, {
|
|
@@ -16158,32 +16585,46 @@ const DriversLicense$2 = ({
|
|
|
16158
16585
|
})
|
|
16159
16586
|
}), jsxs("div", {
|
|
16160
16587
|
className: "adyen-kyc-field-wrapper",
|
|
16161
|
-
children: [jsx(
|
|
16162
|
-
name: "
|
|
16163
|
-
label: getLabel("idNumber", "
|
|
16588
|
+
children: [jsx(MaskedInputText, {
|
|
16589
|
+
name: "idNumber",
|
|
16590
|
+
label: formUtils.getLabel("idNumber", "idNumber"),
|
|
16591
|
+
formatGuidance: formUtils.getGuidanceText("idNumber"),
|
|
16592
|
+
classNameModifiers: {
|
|
16593
|
+
field: ["idNumber"],
|
|
16594
|
+
input: ["idNumber"]
|
|
16595
|
+
},
|
|
16596
|
+
errorMessage: formUtils.getErrorMessage("idNumber", null, void 0),
|
|
16597
|
+
shouldValidate,
|
|
16164
16598
|
isValid: isValid.idNumber,
|
|
16165
|
-
|
|
16166
|
-
|
|
16167
|
-
|
|
16168
|
-
|
|
16169
|
-
|
|
16170
|
-
|
|
16171
|
-
|
|
16172
|
-
|
|
16173
|
-
|
|
16174
|
-
}), jsx(
|
|
16599
|
+
"aria-required": formUtils.isRequiredField("idNumber"),
|
|
16600
|
+
"aria-label": formUtils.getLabel("idNumber"),
|
|
16601
|
+
"aria-invalid": !isValid.idNumber,
|
|
16602
|
+
onBlur: onLicenseNumberBlur,
|
|
16603
|
+
readonly: formUtils.isReadOnly("idNumber"),
|
|
16604
|
+
value: driversLicense2.idNumber ?? "",
|
|
16605
|
+
onInput: onLicenseNumberInput,
|
|
16606
|
+
acceptObscuredValue: formUtils == null ? void 0 : formUtils.isObscured("idNumber"),
|
|
16607
|
+
...formUtils.getMask("idNumber")
|
|
16608
|
+
}), jsx(MaskedInputText, {
|
|
16175
16609
|
name: "licenseCardNumber",
|
|
16176
|
-
label: getLabel("licenseCardNumber"),
|
|
16610
|
+
label: formUtils.getLabel("licenseCardNumber", "licenseCardNumber"),
|
|
16611
|
+
formatGuidance: formUtils.getGuidanceText("licenseCardNumber"),
|
|
16612
|
+
classNameModifiers: {
|
|
16613
|
+
field: ["licenseCardNumber"],
|
|
16614
|
+
input: ["licenseCardNumber"]
|
|
16615
|
+
},
|
|
16616
|
+
errorMessage: formUtils.getErrorMessage("licenseCardNumber", null, void 0),
|
|
16617
|
+
shouldValidate,
|
|
16177
16618
|
isValid: isValid.licenseCardNumber,
|
|
16178
|
-
|
|
16179
|
-
|
|
16180
|
-
|
|
16181
|
-
|
|
16182
|
-
|
|
16183
|
-
|
|
16184
|
-
|
|
16185
|
-
|
|
16186
|
-
|
|
16619
|
+
"aria-required": formUtils.isRequiredField("licenseCardNumber"),
|
|
16620
|
+
"aria-label": formUtils.getLabel("licenseCardNumber"),
|
|
16621
|
+
"aria-invalid": !isValid.licenseCardNumber,
|
|
16622
|
+
onBlur: onCardNumberBlur,
|
|
16623
|
+
readonly: formUtils.isReadOnly("licenseCardNumber"),
|
|
16624
|
+
value: driversLicense2.licenseCardNumber ?? "",
|
|
16625
|
+
onInput: onCardNumberInput,
|
|
16626
|
+
acceptObscuredValue: formUtils == null ? void 0 : formUtils.isObscured("licenseCardNumber"),
|
|
16627
|
+
...formUtils.getMask("licenseCardNumber")
|
|
16187
16628
|
})]
|
|
16188
16629
|
}), jsx(ContextGuidance, {
|
|
16189
16630
|
page: "Personal details",
|
|
@@ -16201,52 +16642,62 @@ const DriversLicense$2 = ({
|
|
|
16201
16642
|
})]
|
|
16202
16643
|
});
|
|
16203
16644
|
};
|
|
16204
|
-
const
|
|
16205
|
-
|
|
16206
|
-
|
|
16207
|
-
|
|
16208
|
-
|
|
16209
|
-
|
|
16210
|
-
|
|
16211
|
-
|
|
16212
|
-
|
|
16213
|
-
|
|
16214
|
-
|
|
16215
|
-
|
|
16216
|
-
|
|
16217
|
-
|
|
16218
|
-
|
|
16219
|
-
|
|
16220
|
-
|
|
16221
|
-
|
|
16222
|
-
|
|
16223
|
-
|
|
16224
|
-
|
|
16225
|
-
|
|
16226
|
-
}
|
|
16227
|
-
|
|
16228
|
-
|
|
16229
|
-
|
|
16230
|
-
|
|
16231
|
-
|
|
16232
|
-
|
|
16233
|
-
|
|
16645
|
+
const licenseCardNumberMetaData$1 = resolveFieldMetadata(licenseCardNumberDefaultConfig[CountryCodes.Australia], {}, licenseCardNumberDefaultMetadata);
|
|
16646
|
+
function IdentityAuComponent({
|
|
16647
|
+
labels: labels2,
|
|
16648
|
+
data: propsData,
|
|
16649
|
+
placeholders,
|
|
16650
|
+
helperText,
|
|
16651
|
+
requiredFields,
|
|
16652
|
+
readOnlyFields,
|
|
16653
|
+
optionalFields,
|
|
16654
|
+
obscuredFields,
|
|
16655
|
+
shouldValidate,
|
|
16656
|
+
fieldValidationErrors,
|
|
16657
|
+
validators
|
|
16658
|
+
}) {
|
|
16659
|
+
const [identityType, setIdentityType] = useState(propsData == null ? void 0 : propsData.typeOfIdentity);
|
|
16660
|
+
if ((propsData == null ? void 0 : propsData.typeOfIdentity) === "nationalIdNumber") {
|
|
16661
|
+
propsData.typeOfIdentity = void 0;
|
|
16662
|
+
}
|
|
16663
|
+
const initialFormUtilProps = {
|
|
16664
|
+
validators: {
|
|
16665
|
+
...auIdentityValidationRules,
|
|
16666
|
+
...validators
|
|
16667
|
+
},
|
|
16668
|
+
labels: labels2,
|
|
16669
|
+
obscuredFields,
|
|
16670
|
+
placeholders,
|
|
16671
|
+
helperText,
|
|
16672
|
+
readOnlyFields,
|
|
16673
|
+
optionalFields,
|
|
16674
|
+
requiredFields
|
|
16675
|
+
};
|
|
16676
|
+
const mergedProps = useMemo(() => {
|
|
16677
|
+
const idNumberMetadata = resolveFieldMetadata(defaultFieldConfig$5[CountryCodes.Australia], {
|
|
16678
|
+
idNumberType: identityType
|
|
16679
|
+
}, defaultFieldMetadata$5);
|
|
16680
|
+
return mergeFieldMetadataIntoProps("idNumber", idNumberMetadata, mergeFieldMetadataIntoProps("licenseCardNumber", licenseCardNumberMetaData$1, initialFormUtilProps));
|
|
16681
|
+
}, [identityType]);
|
|
16682
|
+
const {
|
|
16683
|
+
handleChangeFor,
|
|
16234
16684
|
triggerValidation,
|
|
16235
16685
|
data,
|
|
16236
16686
|
errors,
|
|
16237
16687
|
fieldProblems,
|
|
16238
16688
|
valid
|
|
16239
16689
|
} = useForm({
|
|
16240
|
-
|
|
16241
|
-
|
|
16242
|
-
|
|
16243
|
-
|
|
16244
|
-
|
|
16245
|
-
|
|
16690
|
+
schema: requiredFields ?? [],
|
|
16691
|
+
defaultData: propsData,
|
|
16692
|
+
fieldProblems: fieldValidationErrors,
|
|
16693
|
+
rules: mergedProps.validators,
|
|
16694
|
+
obscuredFields,
|
|
16695
|
+
shouldValidate
|
|
16246
16696
|
});
|
|
16247
16697
|
useEffect(() => {
|
|
16248
|
-
if (data.typeOfIdentity)
|
|
16249
|
-
|
|
16698
|
+
if (data.typeOfIdentity) {
|
|
16699
|
+
setIdentityType(data.typeOfIdentity);
|
|
16700
|
+
}
|
|
16250
16701
|
}, [data.typeOfIdentity]);
|
|
16251
16702
|
const {
|
|
16252
16703
|
sliceData,
|
|
@@ -16264,25 +16715,36 @@ function IdentityAuComponent(props) {
|
|
|
16264
16715
|
const {
|
|
16265
16716
|
i18n
|
|
16266
16717
|
} = useI18nContext();
|
|
16267
|
-
const formUtils = formUtilities(
|
|
16268
|
-
const availableIdentityTypes = ["passport", "driversLicense"];
|
|
16269
|
-
const selectedIdentityType = data.typeOfIdentity;
|
|
16718
|
+
const formUtils = useMemo(() => formUtilities(mergedProps, i18n), [mergedProps]);
|
|
16270
16719
|
return jsxs(Fragment, {
|
|
16271
16720
|
children: [jsx(TypeOfIdentity, {
|
|
16272
|
-
|
|
16273
|
-
selectedIdentityType,
|
|
16721
|
+
availableIdentityTypesOptions: additionallIdNumberOptions.AU,
|
|
16722
|
+
selectedIdentityType: identityType,
|
|
16274
16723
|
setSelectedIdentityType: handleChangeFor("typeOfIdentity"),
|
|
16275
16724
|
label: formUtils.getLabel("typeOfIdentity"),
|
|
16276
16725
|
isValid: valid.typeOfIdentity,
|
|
16277
16726
|
errorMessage: formUtils.getErrorMessage("typeOfIdentity", errors, fieldProblems)
|
|
16278
|
-
}), data.typeOfIdentity === "passport" ? jsx(
|
|
16279
|
-
|
|
16280
|
-
|
|
16281
|
-
|
|
16282
|
-
|
|
16727
|
+
}), data.typeOfIdentity === "passport" ? jsx(MaskedInputText, {
|
|
16728
|
+
name: "idNumber",
|
|
16729
|
+
label: formUtils.getLabel("idNumber", "idNumber"),
|
|
16730
|
+
formatGuidance: formUtils.getGuidanceText("idNumber"),
|
|
16731
|
+
classNameModifiers: {
|
|
16732
|
+
field: ["idNumber"],
|
|
16733
|
+
input: ["idNumber"]
|
|
16734
|
+
},
|
|
16735
|
+
errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldProblems),
|
|
16736
|
+
shouldValidate,
|
|
16283
16737
|
isValid: valid.idNumber,
|
|
16284
|
-
|
|
16285
|
-
|
|
16738
|
+
"aria-required": formUtils.isRequiredField("idNumber"),
|
|
16739
|
+
"aria-label": formUtils.getLabel("idNumber"),
|
|
16740
|
+
"aria-invalid": !valid.idNumber,
|
|
16741
|
+
onBlur: handleChangeFor("idNumber", "blur"),
|
|
16742
|
+
readonly: formUtils.isReadOnly("idNumber"),
|
|
16743
|
+
value: data.idNumber ?? "",
|
|
16744
|
+
onInput: handleChangeFor("idNumber", "input"),
|
|
16745
|
+
acceptObscuredValue: formUtils == null ? void 0 : formUtils.isObscured("idNumber"),
|
|
16746
|
+
...formUtils.getMask("idNumber")
|
|
16747
|
+
}) : data.typeOfIdentity === "driversLicense" ? jsx(DriversLicense$1, {
|
|
16286
16748
|
driversLicense: data,
|
|
16287
16749
|
onIssuerStateChange: handleChangeFor("issuerState"),
|
|
16288
16750
|
onLicenseNumberInput: handleChangeFor("idNumber", "input"),
|
|
@@ -16299,132 +16761,66 @@ function IdentityAuComponent(props) {
|
|
|
16299
16761
|
idNumber: formUtils.getErrorMessage("idNumber", errors, fieldProblems),
|
|
16300
16762
|
licenseCardNumber: formUtils.getErrorMessage("licenseCardNumber", errors, fieldProblems),
|
|
16301
16763
|
issuerState: formUtils.getErrorMessage("issuerState", errors, fieldProblems)
|
|
16302
|
-
}
|
|
16764
|
+
},
|
|
16765
|
+
shouldValidate
|
|
16303
16766
|
}) : void 0]
|
|
16304
16767
|
});
|
|
16305
16768
|
}
|
|
16306
|
-
const isValidatePassportNumber = (value) => PassportNumberPatterns.HK.test(value);
|
|
16307
16769
|
const identityValidationRules = {
|
|
16308
|
-
typeOfIdentity: [isTruthyValidator]
|
|
16309
|
-
idNumber: [{
|
|
16310
|
-
validate: (val, context) => {
|
|
16311
|
-
const value = val ?? "";
|
|
16312
|
-
switch (context == null ? void 0 : context.state.data.typeOfIdentity) {
|
|
16313
|
-
case "passport":
|
|
16314
|
-
return isValidatePassportNumber(value);
|
|
16315
|
-
case "driversLicense":
|
|
16316
|
-
return DriversLicenseNumberPatterns.HK.test(value);
|
|
16317
|
-
case "proofOfIdentityCard":
|
|
16318
|
-
return ProofOfIdentityCardPatterns.HK.test(value);
|
|
16319
|
-
default:
|
|
16320
|
-
return false;
|
|
16321
|
-
}
|
|
16322
|
-
},
|
|
16323
|
-
errorMessage: (_, context) => {
|
|
16324
|
-
switch (context == null ? void 0 : context.state.data.typeOfIdentity) {
|
|
16325
|
-
case "passport":
|
|
16326
|
-
return "invalidFormatForHKPassportNumber";
|
|
16327
|
-
case "driversLicense":
|
|
16328
|
-
return "invalidFormatForHKDriversLicenseNumber";
|
|
16329
|
-
case "proofOfIdentityCard":
|
|
16330
|
-
return "invalidFormatForHKIdentityCardNumber";
|
|
16331
|
-
}
|
|
16332
|
-
},
|
|
16333
|
-
modes: ["blur"]
|
|
16334
|
-
}]
|
|
16335
|
-
};
|
|
16336
|
-
const DriversLicense$1 = ({
|
|
16337
|
-
driversLicense: driversLicense2,
|
|
16338
|
-
onLicenseNumberInput,
|
|
16339
|
-
onLicenseNumberBlur,
|
|
16340
|
-
isValid,
|
|
16341
|
-
errorMessages,
|
|
16342
|
-
label
|
|
16343
|
-
}) => {
|
|
16344
|
-
useI18nContext();
|
|
16345
|
-
return jsx("div", {
|
|
16346
|
-
className: "adyen-kyc-field-wrapper",
|
|
16347
|
-
children: jsx(Field, {
|
|
16348
|
-
name: "licenseNumber",
|
|
16349
|
-
label,
|
|
16350
|
-
isValid: isValid.idNumber,
|
|
16351
|
-
errorMessage: errorMessages.idNumber,
|
|
16352
|
-
children: (childProps) => jsx(InputText, {
|
|
16353
|
-
...childProps,
|
|
16354
|
-
name: "licenseNumber",
|
|
16355
|
-
value: driversLicense2.idNumber,
|
|
16356
|
-
onInput: onLicenseNumberInput,
|
|
16357
|
-
onBlur: onLicenseNumberBlur,
|
|
16358
|
-
placeholder: ""
|
|
16359
|
-
})
|
|
16360
|
-
})
|
|
16361
|
-
});
|
|
16770
|
+
typeOfIdentity: [isTruthyValidator]
|
|
16362
16771
|
};
|
|
16363
|
-
|
|
16364
|
-
|
|
16365
|
-
|
|
16366
|
-
|
|
16367
|
-
|
|
16368
|
-
|
|
16369
|
-
|
|
16370
|
-
|
|
16371
|
-
|
|
16372
|
-
|
|
16373
|
-
|
|
16374
|
-
|
|
16375
|
-
|
|
16376
|
-
|
|
16377
|
-
|
|
16378
|
-
|
|
16379
|
-
onInput,
|
|
16380
|
-
onBlur,
|
|
16381
|
-
placeholder: ""
|
|
16382
|
-
})
|
|
16383
|
-
});
|
|
16384
|
-
const ProofOfIdentityCard = ({
|
|
16385
|
-
cardNumber,
|
|
16386
|
-
onInput,
|
|
16387
|
-
onBlur,
|
|
16388
|
-
label,
|
|
16389
|
-
errorMessage,
|
|
16390
|
-
isValid
|
|
16391
|
-
}) => jsx(Field, {
|
|
16392
|
-
name: "cardNumber",
|
|
16393
|
-
label,
|
|
16394
|
-
errorMessage,
|
|
16395
|
-
isValid,
|
|
16396
|
-
children: (childProps) => jsx(InputText, {
|
|
16397
|
-
...childProps,
|
|
16398
|
-
name: "cardNumber",
|
|
16399
|
-
value: cardNumber,
|
|
16400
|
-
onInput,
|
|
16401
|
-
onBlur,
|
|
16402
|
-
placeholder: ""
|
|
16403
|
-
})
|
|
16404
|
-
});
|
|
16405
|
-
function IdentityHKComponent(props) {
|
|
16406
|
-
var _a;
|
|
16407
|
-
if (((_a = props.data) == null ? void 0 : _a.typeOfIdentity) === "nationalIdNumber") {
|
|
16408
|
-
props.data.typeOfIdentity = void 0;
|
|
16772
|
+
function IdentityHKComponent({
|
|
16773
|
+
labels: labels2,
|
|
16774
|
+
data: propsData,
|
|
16775
|
+
placeholders,
|
|
16776
|
+
helperText,
|
|
16777
|
+
requiredFields,
|
|
16778
|
+
readOnlyFields,
|
|
16779
|
+
optionalFields,
|
|
16780
|
+
obscuredFields,
|
|
16781
|
+
shouldValidate,
|
|
16782
|
+
fieldValidationErrors,
|
|
16783
|
+
validators
|
|
16784
|
+
}) {
|
|
16785
|
+
const [identityType, setIdentityType] = useState(propsData == null ? void 0 : propsData.typeOfIdentity);
|
|
16786
|
+
if ((propsData == null ? void 0 : propsData.typeOfIdentity) === "nationalIdNumber") {
|
|
16787
|
+
propsData.typeOfIdentity = void 0;
|
|
16409
16788
|
}
|
|
16789
|
+
const initialFormUtilProps = {
|
|
16790
|
+
validators: {
|
|
16791
|
+
...identityValidationRules,
|
|
16792
|
+
...validators
|
|
16793
|
+
},
|
|
16794
|
+
labels: labels2,
|
|
16795
|
+
obscuredFields,
|
|
16796
|
+
placeholders,
|
|
16797
|
+
helperText,
|
|
16798
|
+
readOnlyFields,
|
|
16799
|
+
optionalFields,
|
|
16800
|
+
requiredFields
|
|
16801
|
+
};
|
|
16802
|
+
const mergedProps = useMemo(() => {
|
|
16803
|
+
const idNumberMetadata = resolveFieldMetadata(defaultFieldConfig$5[CountryCodes.HongKong], {
|
|
16804
|
+
idNumberType: identityType
|
|
16805
|
+
}, defaultFieldMetadata$5);
|
|
16806
|
+
return mergeFieldMetadataIntoProps("idNumber", idNumberMetadata, initialFormUtilProps);
|
|
16807
|
+
}, [identityType]);
|
|
16410
16808
|
const {
|
|
16411
16809
|
handleChangeFor,
|
|
16412
|
-
triggerValidation,
|
|
16413
16810
|
data,
|
|
16414
16811
|
errors,
|
|
16415
16812
|
fieldProblems,
|
|
16416
16813
|
valid
|
|
16417
16814
|
} = useForm({
|
|
16418
|
-
|
|
16419
|
-
|
|
16420
|
-
|
|
16421
|
-
|
|
16422
|
-
|
|
16423
|
-
maskedFields: props.maskedFields
|
|
16815
|
+
schema: requiredFields ?? [],
|
|
16816
|
+
defaultData: propsData,
|
|
16817
|
+
fieldProblems: fieldValidationErrors,
|
|
16818
|
+
rules: mergedProps.validators,
|
|
16819
|
+
obscuredFields
|
|
16424
16820
|
});
|
|
16425
16821
|
useEffect(() => {
|
|
16426
16822
|
if (data.typeOfIdentity) {
|
|
16427
|
-
|
|
16823
|
+
setIdentityType(data.typeOfIdentity);
|
|
16428
16824
|
}
|
|
16429
16825
|
}, [data.typeOfIdentity]);
|
|
16430
16826
|
const {
|
|
@@ -16445,76 +16841,40 @@ function IdentityHKComponent(props) {
|
|
|
16445
16841
|
const {
|
|
16446
16842
|
i18n
|
|
16447
16843
|
} = useI18nContext();
|
|
16448
|
-
const formUtils = formUtilities(
|
|
16449
|
-
const availableIdentityTypes = ["passport", "driversLicense", "proofOfIdentityCard"];
|
|
16450
|
-
const selectedIdentityType = data.typeOfIdentity;
|
|
16844
|
+
const formUtils = formUtilities(mergedProps, i18n);
|
|
16451
16845
|
return jsxs(Fragment, {
|
|
16452
16846
|
children: [jsx(TypeOfIdentity, {
|
|
16453
|
-
|
|
16454
|
-
selectedIdentityType,
|
|
16847
|
+
availableIdentityTypesOptions: additionallIdNumberOptions.HK,
|
|
16848
|
+
selectedIdentityType: identityType,
|
|
16455
16849
|
setSelectedIdentityType: handleChangeFor("typeOfIdentity"),
|
|
16456
16850
|
label: formUtils.getLabel("typeOfIdentity"),
|
|
16457
16851
|
isValid: valid.typeOfIdentity,
|
|
16458
16852
|
errorMessage: formUtils.getErrorMessage("typeOfIdentity", errors, fieldProblems)
|
|
16459
|
-
}),
|
|
16460
|
-
|
|
16461
|
-
|
|
16462
|
-
|
|
16853
|
+
}), jsx(MaskedInputText, {
|
|
16854
|
+
name: "idNumber",
|
|
16855
|
+
label: formUtils.getLabel("idNumber", "idNumber"),
|
|
16856
|
+
formatGuidance: formUtils.getGuidanceText("idNumber"),
|
|
16857
|
+
classNameModifiers: {
|
|
16858
|
+
field: ["idNumber"],
|
|
16859
|
+
input: ["idNumber"]
|
|
16860
|
+
},
|
|
16861
|
+
errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldProblems),
|
|
16862
|
+
shouldValidate,
|
|
16463
16863
|
isValid: valid.idNumber,
|
|
16464
|
-
|
|
16465
|
-
|
|
16466
|
-
|
|
16467
|
-
cardNumber: data.idNumber ?? "",
|
|
16468
|
-
onInput: handleChangeFor("idNumber", "input"),
|
|
16864
|
+
"aria-required": formUtils.isRequiredField("idNumber"),
|
|
16865
|
+
"aria-label": formUtils.getLabel("idNumber"),
|
|
16866
|
+
"aria-invalid": !valid.idNumber,
|
|
16469
16867
|
onBlur: handleChangeFor("idNumber", "blur"),
|
|
16470
|
-
|
|
16471
|
-
|
|
16472
|
-
|
|
16473
|
-
|
|
16474
|
-
|
|
16475
|
-
|
|
16476
|
-
onLicenseNumberBlur: handleChangeFor("idNumber", "blur"),
|
|
16477
|
-
label: formUtils.getLabel("idNumber", "driverLicense"),
|
|
16478
|
-
isValid: {
|
|
16479
|
-
idNumber: valid.idNumber
|
|
16480
|
-
},
|
|
16481
|
-
errorMessages: {
|
|
16482
|
-
idNumber: formUtils.getErrorMessage("idNumber", errors, fieldProblems)
|
|
16483
|
-
}
|
|
16484
|
-
}) : void 0]
|
|
16868
|
+
readonly: formUtils.isReadOnly("idNumber"),
|
|
16869
|
+
value: data.idNumber ?? "",
|
|
16870
|
+
onInput: handleChangeFor("idNumber", "input"),
|
|
16871
|
+
acceptObscuredValue: formUtils == null ? void 0 : formUtils.isObscured("idNumber"),
|
|
16872
|
+
...formUtils.getMask("idNumber")
|
|
16873
|
+
})]
|
|
16485
16874
|
});
|
|
16486
16875
|
}
|
|
16487
16876
|
const nzIdentityValidationRules = {
|
|
16488
|
-
typeOfIdentity: [isTruthyValidator]
|
|
16489
|
-
idNumber: [{
|
|
16490
|
-
validate: (val, context) => {
|
|
16491
|
-
var _a, _b;
|
|
16492
|
-
const value = val ?? "";
|
|
16493
|
-
switch ((_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.typeOfIdentity) {
|
|
16494
|
-
case "passport":
|
|
16495
|
-
return PassportNumberPatterns[CountryCodes.NewZealand].test(value);
|
|
16496
|
-
case "driversLicense":
|
|
16497
|
-
return DriversLicenseNumberPatterns[CountryCodes.NewZealand].test(value);
|
|
16498
|
-
default:
|
|
16499
|
-
return false;
|
|
16500
|
-
}
|
|
16501
|
-
},
|
|
16502
|
-
errorMessage: (_, context) => {
|
|
16503
|
-
var _a, _b;
|
|
16504
|
-
switch ((_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.typeOfIdentity) {
|
|
16505
|
-
case "passport":
|
|
16506
|
-
return "invalidFormatForNZPassportNumber";
|
|
16507
|
-
case "driversLicense":
|
|
16508
|
-
return "invalidFormatForNZDriversLicenseNumber";
|
|
16509
|
-
}
|
|
16510
|
-
},
|
|
16511
|
-
modes: ["blur"]
|
|
16512
|
-
}],
|
|
16513
|
-
licenseCardNumber: [{
|
|
16514
|
-
validate: (value) => DriversLicenseCardNumberPatterns[CountryCodes.NewZealand].test(value ?? ""),
|
|
16515
|
-
errorMessage: "invalidFormatForNZDriversLicenseCardNumber",
|
|
16516
|
-
modes: ["blur"]
|
|
16517
|
-
}]
|
|
16877
|
+
typeOfIdentity: [isTruthyValidator]
|
|
16518
16878
|
};
|
|
16519
16879
|
const DriversLicense = ({
|
|
16520
16880
|
driversLicense: driversLicense2,
|
|
@@ -16522,11 +16882,10 @@ const DriversLicense = ({
|
|
|
16522
16882
|
onLicenseNumberBlur,
|
|
16523
16883
|
onCardNumberInput,
|
|
16524
16884
|
onCardNumberBlur,
|
|
16525
|
-
formUtils
|
|
16526
|
-
getLabel
|
|
16527
|
-
},
|
|
16885
|
+
formUtils,
|
|
16528
16886
|
isValid,
|
|
16529
|
-
errorMessages
|
|
16887
|
+
errorMessages,
|
|
16888
|
+
shouldValidate
|
|
16530
16889
|
}) => {
|
|
16531
16890
|
const {
|
|
16532
16891
|
i18n
|
|
@@ -16534,32 +16893,46 @@ const DriversLicense = ({
|
|
|
16534
16893
|
return jsxs(Fragment, {
|
|
16535
16894
|
children: [jsxs("div", {
|
|
16536
16895
|
className: "adyen-kyc-field-wrapper",
|
|
16537
|
-
children: [jsx(
|
|
16538
|
-
name: "
|
|
16539
|
-
label: getLabel("idNumber", "
|
|
16540
|
-
|
|
16896
|
+
children: [jsx(MaskedInputText, {
|
|
16897
|
+
name: "idNumber",
|
|
16898
|
+
label: formUtils.getLabel("idNumber", "idNumber"),
|
|
16899
|
+
formatGuidance: formUtils.getGuidanceText("idNumber"),
|
|
16900
|
+
classNameModifiers: {
|
|
16901
|
+
field: ["idNumber"],
|
|
16902
|
+
input: ["idNumber"]
|
|
16903
|
+
},
|
|
16541
16904
|
errorMessage: errorMessages.idNumber,
|
|
16542
|
-
|
|
16543
|
-
|
|
16544
|
-
|
|
16545
|
-
|
|
16546
|
-
|
|
16547
|
-
|
|
16548
|
-
|
|
16549
|
-
|
|
16550
|
-
|
|
16905
|
+
shouldValidate,
|
|
16906
|
+
isValid: isValid.idNumber,
|
|
16907
|
+
"aria-required": formUtils.isRequiredField("idNumber"),
|
|
16908
|
+
"aria-label": formUtils.getLabel("idNumber"),
|
|
16909
|
+
"aria-invalid": !isValid.idNumber,
|
|
16910
|
+
onBlur: onLicenseNumberBlur,
|
|
16911
|
+
readonly: formUtils.isReadOnly("idNumber"),
|
|
16912
|
+
value: driversLicense2.idNumber ?? "",
|
|
16913
|
+
onInput: onLicenseNumberInput,
|
|
16914
|
+
acceptObscuredValue: formUtils == null ? void 0 : formUtils.isObscured("idNumber"),
|
|
16915
|
+
...formUtils.getMask("idNumber")
|
|
16916
|
+
}), jsx(MaskedInputText, {
|
|
16551
16917
|
name: "licenseCardNumber",
|
|
16552
|
-
label: getLabel("
|
|
16553
|
-
|
|
16918
|
+
label: formUtils.getLabel("licenseCardNumber", "licenseCardNumber"),
|
|
16919
|
+
formatGuidance: formUtils.getGuidanceText("licenseCardNumber"),
|
|
16920
|
+
classNameModifiers: {
|
|
16921
|
+
field: ["licenseCardNumber"],
|
|
16922
|
+
input: ["licenseCardNumber"]
|
|
16923
|
+
},
|
|
16554
16924
|
errorMessage: errorMessages.licenseCardNumber,
|
|
16555
|
-
|
|
16556
|
-
|
|
16557
|
-
|
|
16558
|
-
|
|
16559
|
-
|
|
16560
|
-
|
|
16561
|
-
|
|
16562
|
-
|
|
16925
|
+
shouldValidate,
|
|
16926
|
+
isValid: isValid.licenseCardNumber,
|
|
16927
|
+
"aria-required": formUtils.isRequiredField("licenseCardNumber"),
|
|
16928
|
+
"aria-label": formUtils.getLabel("licenseCardNumber"),
|
|
16929
|
+
"aria-invalid": !isValid.licenseCardNumber,
|
|
16930
|
+
onBlur: onCardNumberBlur,
|
|
16931
|
+
readonly: formUtils.isReadOnly("licenseCardNumber"),
|
|
16932
|
+
value: driversLicense2.licenseCardNumber ?? "",
|
|
16933
|
+
onInput: onCardNumberInput,
|
|
16934
|
+
acceptObscuredValue: formUtils == null ? void 0 : formUtils.isObscured("licenseCardNumber"),
|
|
16935
|
+
...formUtils.getMask("licenseCardNumber")
|
|
16563
16936
|
})]
|
|
16564
16937
|
}), jsx(ContextGuidance, {
|
|
16565
16938
|
page: "Personal details",
|
|
@@ -16577,34 +16950,43 @@ const DriversLicense = ({
|
|
|
16577
16950
|
})]
|
|
16578
16951
|
});
|
|
16579
16952
|
};
|
|
16580
|
-
const
|
|
16581
|
-
|
|
16582
|
-
|
|
16583
|
-
|
|
16584
|
-
|
|
16585
|
-
|
|
16586
|
-
|
|
16587
|
-
|
|
16588
|
-
|
|
16589
|
-
|
|
16590
|
-
|
|
16591
|
-
|
|
16592
|
-
|
|
16593
|
-
|
|
16594
|
-
|
|
16595
|
-
|
|
16596
|
-
|
|
16597
|
-
value: passportNumber2,
|
|
16598
|
-
onInput,
|
|
16599
|
-
onBlur,
|
|
16600
|
-
placeholder: ""
|
|
16601
|
-
})
|
|
16602
|
-
});
|
|
16603
|
-
function IdentityNZComponent(props) {
|
|
16604
|
-
var _a;
|
|
16605
|
-
if (((_a = props.data) == null ? void 0 : _a.typeOfIdentity) === "nationalIdNumber") {
|
|
16606
|
-
props.data.typeOfIdentity = void 0;
|
|
16953
|
+
const licenseCardNumberMetaData = resolveFieldMetadata(licenseCardNumberDefaultConfig[CountryCodes.NewZealand], {}, licenseCardNumberDefaultMetadata);
|
|
16954
|
+
function IdentityNZComponent({
|
|
16955
|
+
labels: labels2,
|
|
16956
|
+
data: propsData,
|
|
16957
|
+
placeholders,
|
|
16958
|
+
helperText,
|
|
16959
|
+
requiredFields,
|
|
16960
|
+
readOnlyFields,
|
|
16961
|
+
optionalFields,
|
|
16962
|
+
obscuredFields,
|
|
16963
|
+
shouldValidate,
|
|
16964
|
+
fieldValidationErrors,
|
|
16965
|
+
validators
|
|
16966
|
+
}) {
|
|
16967
|
+
const [identityType, setIdentityType] = useState(propsData == null ? void 0 : propsData.typeOfIdentity);
|
|
16968
|
+
if ((propsData == null ? void 0 : propsData.typeOfIdentity) === "nationalIdNumber") {
|
|
16969
|
+
propsData.typeOfIdentity = void 0;
|
|
16607
16970
|
}
|
|
16971
|
+
const initialFormUtilProps = {
|
|
16972
|
+
validators: {
|
|
16973
|
+
...nzIdentityValidationRules,
|
|
16974
|
+
...validators
|
|
16975
|
+
},
|
|
16976
|
+
labels: labels2,
|
|
16977
|
+
obscuredFields,
|
|
16978
|
+
placeholders,
|
|
16979
|
+
helperText,
|
|
16980
|
+
readOnlyFields,
|
|
16981
|
+
optionalFields,
|
|
16982
|
+
requiredFields
|
|
16983
|
+
};
|
|
16984
|
+
const mergedProps = useMemo(() => {
|
|
16985
|
+
const idNumberMetadata = resolveFieldMetadata(defaultFieldConfig$5[CountryCodes.NewZealand], {
|
|
16986
|
+
idNumberType: identityType
|
|
16987
|
+
}, defaultFieldMetadata$5);
|
|
16988
|
+
return mergeFieldMetadataIntoProps("idNumber", idNumberMetadata, mergeFieldMetadataIntoProps("licenseCardNumber", licenseCardNumberMetaData, initialFormUtilProps));
|
|
16989
|
+
}, [identityType]);
|
|
16608
16990
|
const {
|
|
16609
16991
|
handleChangeFor,
|
|
16610
16992
|
triggerValidation,
|
|
@@ -16613,16 +16995,17 @@ function IdentityNZComponent(props) {
|
|
|
16613
16995
|
fieldProblems,
|
|
16614
16996
|
valid
|
|
16615
16997
|
} = useForm({
|
|
16616
|
-
|
|
16617
|
-
|
|
16618
|
-
|
|
16619
|
-
|
|
16620
|
-
|
|
16621
|
-
|
|
16998
|
+
schema: requiredFields ?? [],
|
|
16999
|
+
defaultData: propsData,
|
|
17000
|
+
fieldProblems: fieldValidationErrors,
|
|
17001
|
+
rules: mergedProps.validators,
|
|
17002
|
+
obscuredFields,
|
|
17003
|
+
shouldValidate
|
|
16622
17004
|
});
|
|
16623
17005
|
useEffect(() => {
|
|
16624
|
-
if (data.typeOfIdentity)
|
|
16625
|
-
|
|
17006
|
+
if (data.typeOfIdentity) {
|
|
17007
|
+
setIdentityType(data.typeOfIdentity);
|
|
17008
|
+
}
|
|
16626
17009
|
}, [data.typeOfIdentity]);
|
|
16627
17010
|
const {
|
|
16628
17011
|
sliceData,
|
|
@@ -16640,28 +17023,39 @@ function IdentityNZComponent(props) {
|
|
|
16640
17023
|
const {
|
|
16641
17024
|
i18n
|
|
16642
17025
|
} = useI18nContext();
|
|
16643
|
-
const formUtils = formUtilities(
|
|
16644
|
-
const availableIdentityTypes = ["passport", "driversLicense"];
|
|
16645
|
-
const selectedIdentityType = data.typeOfIdentity;
|
|
17026
|
+
const formUtils = formUtilities(mergedProps, i18n);
|
|
16646
17027
|
const today = /* @__PURE__ */ new Date();
|
|
16647
17028
|
const maxExpiryDateSelection = new Date((/* @__PURE__ */ new Date()).setFullYear(today.getFullYear() + 10));
|
|
16648
17029
|
return jsxs(Fragment, {
|
|
16649
17030
|
children: [jsx(TypeOfIdentity, {
|
|
16650
|
-
|
|
16651
|
-
selectedIdentityType,
|
|
17031
|
+
availableIdentityTypesOptions: additionallIdNumberOptions.NZ,
|
|
17032
|
+
selectedIdentityType: identityType,
|
|
16652
17033
|
setSelectedIdentityType: handleChangeFor("typeOfIdentity"),
|
|
16653
17034
|
label: formUtils.getLabel("typeOfIdentity"),
|
|
16654
17035
|
isValid: valid.typeOfIdentity,
|
|
16655
17036
|
errorMessage: formUtils.getErrorMessage("typeOfIdentity", errors, fieldProblems)
|
|
16656
17037
|
}), data.typeOfIdentity === "passport" ? jsxs("div", {
|
|
16657
17038
|
className: "adyen-kyc-field-wrapper",
|
|
16658
|
-
children: [jsx(
|
|
16659
|
-
|
|
16660
|
-
|
|
16661
|
-
|
|
16662
|
-
|
|
17039
|
+
children: [jsx(MaskedInputText, {
|
|
17040
|
+
name: "idNumber",
|
|
17041
|
+
label: formUtils.getLabel("idNumber", "idNumber"),
|
|
17042
|
+
formatGuidance: formUtils.getGuidanceText("idNumber"),
|
|
17043
|
+
classNameModifiers: {
|
|
17044
|
+
field: ["idNumber"],
|
|
17045
|
+
input: ["idNumber"]
|
|
17046
|
+
},
|
|
17047
|
+
errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldProblems),
|
|
17048
|
+
shouldValidate,
|
|
16663
17049
|
isValid: valid.idNumber,
|
|
16664
|
-
|
|
17050
|
+
"aria-required": formUtils.isRequiredField("idNumber"),
|
|
17051
|
+
"aria-label": formUtils.getLabel("idNumber"),
|
|
17052
|
+
"aria-invalid": !valid.idNumber,
|
|
17053
|
+
onBlur: handleChangeFor("idNumber", "blur"),
|
|
17054
|
+
readonly: formUtils.isReadOnly("idNumber"),
|
|
17055
|
+
value: data.idNumber ?? "",
|
|
17056
|
+
onInput: handleChangeFor("idNumber", "input"),
|
|
17057
|
+
acceptObscuredValue: formUtils == null ? void 0 : formUtils.isObscured("idNumber"),
|
|
17058
|
+
...formUtils.getMask("idNumber")
|
|
16665
17059
|
}), jsx(Field, {
|
|
16666
17060
|
name: "expiryDate",
|
|
16667
17061
|
label: formUtils.getLabel("passportExpiryDate"),
|
|
@@ -16697,7 +17091,8 @@ function IdentityNZComponent(props) {
|
|
|
16697
17091
|
errorMessages: {
|
|
16698
17092
|
idNumber: formUtils.getErrorMessage("idNumber", errors, fieldProblems),
|
|
16699
17093
|
licenseCardNumber: formUtils.getErrorMessage("licenseCardNumber", errors, fieldProblems)
|
|
16700
|
-
}
|
|
17094
|
+
},
|
|
17095
|
+
shouldValidate
|
|
16701
17096
|
}) : void 0]
|
|
16702
17097
|
});
|
|
16703
17098
|
}
|
|
@@ -16706,41 +17101,14 @@ const ERROR_CODES = {
|
|
|
16706
17101
|
SSN_4_DIGITS_VALIDATION: "1_3062",
|
|
16707
17102
|
PERSONAL_DETAILS_VALIDATION: "1_30"
|
|
16708
17103
|
};
|
|
16709
|
-
const OPTIONS_SSN = {
|
|
16710
|
-
fourDigits: "4DigitSSN",
|
|
16711
|
-
nineDigits: "entireSSN"
|
|
16712
|
-
};
|
|
16713
17104
|
const IdentityUSComponent = forwardRef((props, ref) => {
|
|
16714
17105
|
var _a, _b, _c, _d;
|
|
16715
17106
|
const individualDetailsError = (_a = props.formVerificationErrors) == null ? void 0 : _a[ERROR_CODES.PERSONAL_DETAILS_VALIDATION];
|
|
16716
17107
|
const fourDigitsValidationError = (_b = individualDetailsError == null ? void 0 : individualDetailsError[ERROR_CODES.SSN_4_DIGITS_VALIDATION]) == null ? void 0 : _b.some((error) => error.code === ERROR_CODES.SSN_REMEDIATION);
|
|
16717
|
-
const ssnType = fourDigitsValidationError || ((_d = (_c = props.data) == null ? void 0 : _c.idNumber) == null ? void 0 : _d.length) === 9 ?
|
|
16718
|
-
let USIdentityProps = {
|
|
16719
|
-
...props
|
|
16720
|
-
};
|
|
16721
|
-
if (ssnType === OPTIONS_SSN.nineDigits) {
|
|
16722
|
-
const nineDigitsProps = {
|
|
16723
|
-
labels: {
|
|
16724
|
-
...props.labels,
|
|
16725
|
-
idNumber: "socialSecurityNumber9Digits"
|
|
16726
|
-
},
|
|
16727
|
-
country: "US9",
|
|
16728
|
-
placeholders: {
|
|
16729
|
-
...props.placeholders,
|
|
16730
|
-
idNumber: "SSNFormatUS9Digits"
|
|
16731
|
-
}
|
|
16732
|
-
};
|
|
16733
|
-
USIdentityProps = {
|
|
16734
|
-
...props,
|
|
16735
|
-
...nineDigitsProps
|
|
16736
|
-
};
|
|
16737
|
-
}
|
|
16738
|
-
if (ssnType === OPTIONS_SSN.fourDigits) {
|
|
16739
|
-
USIdentityProps.classNames = ["us4DigitsNumberId"];
|
|
16740
|
-
USIdentityProps.dataPlaceholder = "*** — ** — ";
|
|
16741
|
-
}
|
|
17108
|
+
const ssnType = fourDigitsValidationError || ((_d = (_c = props.data) == null ? void 0 : _c.idNumber) == null ? void 0 : _d.length) === 9 ? "ssn" : "ssnLastFour";
|
|
16742
17109
|
return jsx(IdentityNumberComponent, {
|
|
16743
|
-
...
|
|
17110
|
+
...props,
|
|
17111
|
+
idNumberType: ssnType,
|
|
16744
17112
|
ref
|
|
16745
17113
|
});
|
|
16746
17114
|
});
|
|
@@ -16793,9 +17161,6 @@ function IdentityComponent(props) {
|
|
|
16793
17161
|
dataStoreId
|
|
16794
17162
|
});
|
|
16795
17163
|
}
|
|
16796
|
-
const customFieldlabels = (selected) => ({
|
|
16797
|
-
idNumber: selected
|
|
16798
|
-
});
|
|
16799
17164
|
const personalDetailsFields = [...nameFields, "birthDate", ...idNumberFields, ...additionalIdentityInfoFields, "residencyCountry", "nationality", "jobTitle", ...decisionMakerRoleFields, ...contactDetailFields, ...accountHolderFields];
|
|
16800
17165
|
function PersonalDetailsComponent(props) {
|
|
16801
17166
|
var _a;
|
|
@@ -16893,7 +17258,6 @@ function PersonalDetailsComponent(props) {
|
|
|
16893
17258
|
useEffect(() => {
|
|
16894
17259
|
setIdNumberType(defaultIdNumberType);
|
|
16895
17260
|
}, [props.data.residencyCountry]);
|
|
16896
|
-
const idNumberCustomLabel = customFieldlabels ? customFieldlabels(idNumberType) : {};
|
|
16897
17261
|
useEffect(() => {
|
|
16898
17262
|
stateRef.current.setState({
|
|
16899
17263
|
type: "addToState",
|
|
@@ -17000,8 +17364,7 @@ function PersonalDetailsComponent(props) {
|
|
|
17000
17364
|
personalDetails: props,
|
|
17001
17365
|
country: data.residencyCountry,
|
|
17002
17366
|
errors: externalErrors,
|
|
17003
|
-
idNumberType
|
|
17004
|
-
labels: idNumberCustomLabel
|
|
17367
|
+
idNumberType
|
|
17005
17368
|
}), (data.residencyCountry === "SG" || data.residencyCountry === "HK") && formUtils.isRequiredField("nationality") && jsx(CountryField, {
|
|
17006
17369
|
data: {
|
|
17007
17370
|
country: data.nationality
|
|
@@ -18316,26 +18679,13 @@ const createDelimitedStringFormatter = (char, indexes) => (val) => indexes.reduc
|
|
|
18316
18679
|
const slicePoint = delimiterIndex + index;
|
|
18317
18680
|
return slicePoint < acc.length ? [...acc.slice(0, slicePoint), "-", ...acc.slice(slicePoint)] : acc;
|
|
18318
18681
|
}, val.replaceAll("-", "").split("")).join("");
|
|
18319
|
-
|
|
18682
|
+
({
|
|
18320
18683
|
[CountryCodes.NewZealand]: {
|
|
18321
18684
|
bankAccountNumber: {
|
|
18322
18685
|
// We want to add "-" after the 2nd, 6th and 13th numbers for New Zealand
|
|
18323
18686
|
formatter: (val) => val ? createDelimitedStringFormatter("-", [2, 6, 13])(val) : val
|
|
18324
18687
|
}
|
|
18325
18688
|
}
|
|
18326
|
-
};
|
|
18327
|
-
const getBankAccountNumberFormatters = (country2, prependFormatters) => ({
|
|
18328
|
-
bankAccountNumber: {
|
|
18329
|
-
formatter: (val) => {
|
|
18330
|
-
var _a, _b;
|
|
18331
|
-
const preformattedValue = prependFormatters.reduce((acc, formatter) => formatter(acc), val);
|
|
18332
|
-
const specificRule = (_b = (_a = countrySpecificBankAccountNumberFormatters[country2]) == null ? void 0 : _a.bankAccountNumber) == null ? void 0 : _b.formatter;
|
|
18333
|
-
if (specificRule) {
|
|
18334
|
-
return specificRule(preformattedValue);
|
|
18335
|
-
}
|
|
18336
|
-
return preformattedValue;
|
|
18337
|
-
}
|
|
18338
|
-
}
|
|
18339
18689
|
});
|
|
18340
18690
|
function BankAccountFormat(props) {
|
|
18341
18691
|
const {
|
|
@@ -18370,78 +18720,139 @@ function BankAccountFormat(props) {
|
|
|
18370
18720
|
})
|
|
18371
18721
|
});
|
|
18372
18722
|
}
|
|
18373
|
-
const
|
|
18374
|
-
|
|
18375
|
-
|
|
18376
|
-
|
|
18723
|
+
const simpleBankAccountNumberMetadata = (example, length, maxLength) => {
|
|
18724
|
+
if (maxLength) {
|
|
18725
|
+
return {
|
|
18726
|
+
label: "bankAccountNumber",
|
|
18727
|
+
validators: validatePatternOnBlur(new RegExp(`^\\d{${length},${maxLength}}$`)),
|
|
18728
|
+
mask: {
|
|
18729
|
+
mask: makeMask(...numericInputs(length), ...numericInputs(maxLength - length, true))
|
|
18730
|
+
},
|
|
18731
|
+
guidanceText: {
|
|
18732
|
+
key: "enterAMaximumOfNDigitsForExample",
|
|
18733
|
+
values: {
|
|
18734
|
+
maxDigits: `${maxLength}`,
|
|
18735
|
+
example
|
|
18736
|
+
}
|
|
18737
|
+
}
|
|
18738
|
+
};
|
|
18739
|
+
}
|
|
18740
|
+
return {
|
|
18741
|
+
label: "bankAccountNumber",
|
|
18742
|
+
validators: validatePatternOnBlur(new RegExp(`^\\d{${length}}$`)),
|
|
18743
|
+
mask: {
|
|
18744
|
+
mask: makeMask(...numericInputs(length))
|
|
18745
|
+
},
|
|
18746
|
+
guidanceText: {
|
|
18747
|
+
key: "enterNDigitsForExample",
|
|
18748
|
+
values: {
|
|
18749
|
+
numDigits: `${length}`,
|
|
18750
|
+
example
|
|
18751
|
+
}
|
|
18752
|
+
}
|
|
18753
|
+
};
|
|
18377
18754
|
};
|
|
18378
|
-
const
|
|
18379
|
-
|
|
18755
|
+
const defaultFieldMetadata$4 = {
|
|
18756
|
+
label: "bankAccountNumber",
|
|
18757
|
+
validators: isNotEmptyValidator
|
|
18758
|
+
};
|
|
18759
|
+
const defaultFieldConfig$4 = {
|
|
18760
|
+
[CountryCodes.Denmark]: simpleBankAccountNumberMetadata("2621955959", 10),
|
|
18761
|
+
[CountryCodes.Norway]: simpleBankAccountNumberMetadata("1117947", 7),
|
|
18762
|
+
[CountryCodes.UnitedKingdom]: simpleBankAccountNumberMetadata("10000003", 8),
|
|
18763
|
+
[CountryCodes.Australia]: simpleBankAccountNumberMetadata("0001234", 5, 10),
|
|
18764
|
+
[CountryCodes.Brazil]: simpleBankAccountNumberMetadata("0009795493", 4, 12),
|
|
18765
|
+
[CountryCodes.Canada]: simpleBankAccountNumberMetadata("10220001111", 5, 12),
|
|
18766
|
+
[CountryCodes.HongKong]: simpleBankAccountNumberMetadata("123456789001", 6, 18),
|
|
18767
|
+
[CountryCodes.Singapore]: simpleBankAccountNumberMetadata("0052312891876", 4, 19),
|
|
18768
|
+
[CountryCodes.Sweden]: simpleBankAccountNumberMetadata("123456789", 7, 10),
|
|
18769
|
+
[CountryCodes.UnitedStates]: simpleBankAccountNumberMetadata("10220001111", 3, 17),
|
|
18770
|
+
[CountryCodes.Poland]: {
|
|
18771
|
+
label: "bankAccountNumber",
|
|
18772
|
+
validators: validatePatternOnBlur(/^\d{26}$/),
|
|
18773
|
+
mask: {
|
|
18774
|
+
mask: makeMask(...numericInputs(2), spacer, ...numericInputs(4), spacer, ...numericInputs(4), spacer, ...numericInputs(4), spacer, ...numericInputs(4), spacer, ...numericInputs(4), spacer, ...numericInputs(4))
|
|
18775
|
+
},
|
|
18776
|
+
guidanceText: {
|
|
18777
|
+
key: "enterNDigitsForExample",
|
|
18778
|
+
values: {
|
|
18779
|
+
numDigits: "26",
|
|
18780
|
+
example: "98 1090 2402 7474 4662 2173 1624"
|
|
18781
|
+
}
|
|
18782
|
+
}
|
|
18783
|
+
},
|
|
18784
|
+
[CountryCodes.NewZealand]: {
|
|
18785
|
+
label: "bankAccountNumber",
|
|
18786
|
+
validators: validatePatternOnBlur(/^\d{26}$/),
|
|
18787
|
+
mask: {
|
|
18788
|
+
mask: makeMask(...numericInputs(2), ...nonInputs(" - "), ...numericInputs(4), ...nonInputs(" - "), ...numericInputs(7), ...nonInputs(" - "), ...numericInputs(2), ...numericInputs(1, true))
|
|
18789
|
+
},
|
|
18790
|
+
guidanceText: {
|
|
18791
|
+
key: "enterXToYDigitsForExample",
|
|
18792
|
+
values: {
|
|
18793
|
+
minDigits: "15",
|
|
18794
|
+
maxDigits: "16",
|
|
18795
|
+
example: "12-8765-9876543-043"
|
|
18796
|
+
}
|
|
18797
|
+
}
|
|
18798
|
+
}
|
|
18799
|
+
};
|
|
18800
|
+
const bankAccountNumberFields = ["bankAccountNumber"];
|
|
18801
|
+
function BankAccountNumber(props) {
|
|
18380
18802
|
const {
|
|
18381
18803
|
i18n
|
|
18382
18804
|
} = useI18nContext();
|
|
18383
18805
|
const {
|
|
18384
|
-
|
|
18385
|
-
|
|
18386
|
-
country: country2
|
|
18806
|
+
country: country2,
|
|
18807
|
+
fieldConfig = defaultFieldConfig$4
|
|
18387
18808
|
} = props;
|
|
18388
|
-
const
|
|
18389
|
-
|
|
18390
|
-
});
|
|
18391
|
-
const formatters = getBankAccountNumberFormatters(country2, [(v) => v && !isValueMasked(v) ? stripNonAlphanumeric(v) : v]);
|
|
18809
|
+
const metadata = resolveFieldMetadata(fieldConfig[country2], {}, defaultFieldMetadata$4);
|
|
18810
|
+
const mergedProps = mergeFieldMetadataIntoProps("bankAccountNumber", metadata, props);
|
|
18392
18811
|
const {
|
|
18393
18812
|
handleChangeFor,
|
|
18394
18813
|
data,
|
|
18395
18814
|
valid,
|
|
18396
18815
|
errors,
|
|
18397
|
-
isValid,
|
|
18398
18816
|
fieldProblems
|
|
18399
18817
|
} = useForm({
|
|
18400
|
-
...
|
|
18818
|
+
...mergedProps,
|
|
18401
18819
|
schema: bankAccountNumberFields,
|
|
18402
|
-
rules: validators,
|
|
18403
|
-
defaultData:
|
|
18404
|
-
fieldProblems:
|
|
18405
|
-
|
|
18406
|
-
maskedFields: props.maskedFields
|
|
18820
|
+
rules: mergedProps.validators,
|
|
18821
|
+
defaultData: mergedProps.data,
|
|
18822
|
+
fieldProblems: mergedProps == null ? void 0 : mergedProps.fieldValidationErrors,
|
|
18823
|
+
obscuredFields: mergedProps.obscuredFields
|
|
18407
18824
|
});
|
|
18825
|
+
const {
|
|
18826
|
+
updateStateSlice
|
|
18827
|
+
} = useGlobalDataSlice("payoutAccountDetails", "bankAccountNumber");
|
|
18408
18828
|
useEffect(() => {
|
|
18409
|
-
|
|
18410
|
-
|
|
18411
|
-
|
|
18412
|
-
|
|
18413
|
-
|
|
18414
|
-
valid,
|
|
18415
|
-
errors,
|
|
18416
|
-
fieldProblems,
|
|
18417
|
-
caller: "bankAccountNumber",
|
|
18418
|
-
dataStoreId
|
|
18419
|
-
}
|
|
18829
|
+
updateStateSlice({
|
|
18830
|
+
data,
|
|
18831
|
+
valid,
|
|
18832
|
+
errors,
|
|
18833
|
+
fieldProblems
|
|
18420
18834
|
});
|
|
18421
|
-
}, [data, valid, errors
|
|
18422
|
-
const formUtils = formUtilities(
|
|
18423
|
-
return
|
|
18424
|
-
|
|
18425
|
-
|
|
18426
|
-
|
|
18427
|
-
|
|
18428
|
-
|
|
18429
|
-
|
|
18430
|
-
|
|
18431
|
-
|
|
18432
|
-
|
|
18433
|
-
|
|
18434
|
-
|
|
18435
|
-
|
|
18436
|
-
|
|
18437
|
-
|
|
18438
|
-
|
|
18439
|
-
|
|
18440
|
-
|
|
18441
|
-
|
|
18442
|
-
value: data.bankAccountNumber
|
|
18443
|
-
})
|
|
18444
|
-
})]
|
|
18835
|
+
}, [data, valid, errors]);
|
|
18836
|
+
const formUtils = formUtilities(mergedProps, i18n);
|
|
18837
|
+
return jsx(MaskedInputText, {
|
|
18838
|
+
name: "bankAccountNumber",
|
|
18839
|
+
label: formUtils.getLabel("bankAccountNumber"),
|
|
18840
|
+
formatGuidance: formUtils.getGuidanceText("bankAccountNumber"),
|
|
18841
|
+
...formUtils.getMask("bankAccountNumber"),
|
|
18842
|
+
isValid: valid.bankAccountNumber,
|
|
18843
|
+
errorMessage: formUtils.getErrorMessage("bankAccountNumber", errors, fieldProblems),
|
|
18844
|
+
"aria-required": true,
|
|
18845
|
+
"aria-invalid": !valid.bankAccountNumber,
|
|
18846
|
+
"aria-label": formUtils.getLabel("bankAccountNumber"),
|
|
18847
|
+
classNameModifiers: {
|
|
18848
|
+
field: ["bankAccountNumber"],
|
|
18849
|
+
input: ["bankAccountNumber"]
|
|
18850
|
+
},
|
|
18851
|
+
onBlur: handleChangeFor("bankAccountNumber", "blur"),
|
|
18852
|
+
onInput: handleChangeFor("bankAccountNumber", "input"),
|
|
18853
|
+
readonly: formUtils.isReadOnly("bankAccountNumber"),
|
|
18854
|
+
value: data.bankAccountNumber ?? "",
|
|
18855
|
+
acceptObscuredValue: formUtils.isObscured("bankAccountNumber")
|
|
18445
18856
|
});
|
|
18446
18857
|
}
|
|
18447
18858
|
const bankCityFields = ["bankCity"];
|
|
@@ -18450,18 +18861,13 @@ function BankCity(props) {
|
|
|
18450
18861
|
i18n
|
|
18451
18862
|
} = useI18nContext();
|
|
18452
18863
|
const {
|
|
18453
|
-
dataStoreId,
|
|
18454
18864
|
validators
|
|
18455
18865
|
} = props;
|
|
18456
|
-
const stateRef = useRef({
|
|
18457
|
-
setState: null
|
|
18458
|
-
});
|
|
18459
18866
|
const {
|
|
18460
18867
|
handleChangeFor,
|
|
18461
18868
|
data,
|
|
18462
18869
|
valid,
|
|
18463
18870
|
errors,
|
|
18464
|
-
isValid,
|
|
18465
18871
|
fieldProblems
|
|
18466
18872
|
} = useForm({
|
|
18467
18873
|
...props,
|
|
@@ -18470,106 +18876,120 @@ function BankCity(props) {
|
|
|
18470
18876
|
defaultData: props.data,
|
|
18471
18877
|
fieldProblems: props == null ? void 0 : props.fieldValidationErrors
|
|
18472
18878
|
});
|
|
18879
|
+
const {
|
|
18880
|
+
updateStateSlice
|
|
18881
|
+
} = useGlobalDataSlice("payoutAccountDetails", "bankCity");
|
|
18473
18882
|
useEffect(() => {
|
|
18474
|
-
|
|
18475
|
-
|
|
18476
|
-
|
|
18477
|
-
|
|
18478
|
-
|
|
18479
|
-
valid,
|
|
18480
|
-
errors,
|
|
18481
|
-
fieldProblems,
|
|
18482
|
-
caller: "bankCity",
|
|
18483
|
-
dataStoreId
|
|
18484
|
-
}
|
|
18883
|
+
updateStateSlice({
|
|
18884
|
+
data,
|
|
18885
|
+
valid,
|
|
18886
|
+
errors,
|
|
18887
|
+
fieldProblems
|
|
18485
18888
|
});
|
|
18486
|
-
}, [data, valid, errors
|
|
18889
|
+
}, [data, valid, errors]);
|
|
18487
18890
|
const formUtils = formUtilities(props, i18n);
|
|
18488
|
-
return
|
|
18489
|
-
|
|
18490
|
-
|
|
18491
|
-
|
|
18891
|
+
return jsx(Field, {
|
|
18892
|
+
name: "bankCity",
|
|
18893
|
+
label: formUtils.getLabel("bankCity"),
|
|
18894
|
+
classNameModifiers: ["bankCity"],
|
|
18895
|
+
errorMessage: formUtils.getErrorMessage("bankCity", errors, fieldProblems),
|
|
18896
|
+
isValid: valid.bankCity,
|
|
18897
|
+
children: (childProps) => jsx(InputText, {
|
|
18898
|
+
...childProps,
|
|
18492
18899
|
name: "bankCity",
|
|
18493
|
-
|
|
18494
|
-
|
|
18495
|
-
|
|
18496
|
-
|
|
18497
|
-
|
|
18498
|
-
|
|
18499
|
-
|
|
18500
|
-
|
|
18501
|
-
readonly: formUtils.isReadOnly("bankCity"),
|
|
18502
|
-
onInput: handleChangeFor("bankCity", "input"),
|
|
18503
|
-
onBlur: handleChangeFor("bankCity", "blur"),
|
|
18504
|
-
"aria-required": true,
|
|
18505
|
-
"aria-label": formUtils.getLabel("bankCity"),
|
|
18506
|
-
"aria-invalid": !valid.bankCity
|
|
18507
|
-
})
|
|
18508
|
-
})]
|
|
18900
|
+
value: data.bankCity,
|
|
18901
|
+
readonly: formUtils.isReadOnly("bankCity"),
|
|
18902
|
+
onInput: handleChangeFor("bankCity", "input"),
|
|
18903
|
+
onBlur: handleChangeFor("bankCity", "blur"),
|
|
18904
|
+
"aria-required": true,
|
|
18905
|
+
"aria-label": formUtils.getLabel("bankCity"),
|
|
18906
|
+
"aria-invalid": !valid.bankCity
|
|
18907
|
+
})
|
|
18509
18908
|
});
|
|
18510
18909
|
}
|
|
18910
|
+
const defaultFieldMetadata$3 = {
|
|
18911
|
+
label: "bankCode",
|
|
18912
|
+
validators: isNotEmptyValidator
|
|
18913
|
+
};
|
|
18914
|
+
const simpleBankCodeMetadata = (length, example, label) => ({
|
|
18915
|
+
label: label ?? "bankCode",
|
|
18916
|
+
validators: validatePatternOnBlur(new RegExp(`^\\d{${length}}$`)),
|
|
18917
|
+
mask: {
|
|
18918
|
+
mask: makeMask(...numericInputs(length))
|
|
18919
|
+
},
|
|
18920
|
+
guidanceText: {
|
|
18921
|
+
key: "enterNDigitsForExample",
|
|
18922
|
+
values: {
|
|
18923
|
+
numDigits: `${length}`,
|
|
18924
|
+
example
|
|
18925
|
+
}
|
|
18926
|
+
}
|
|
18927
|
+
});
|
|
18928
|
+
const defaultFieldConfig$3 = {
|
|
18929
|
+
[CountryCodes.Brazil]: simpleBankCodeMetadata(3, "123"),
|
|
18930
|
+
[CountryCodes.Canada]: simpleBankCodeMetadata(3, "100", "institutionNumber"),
|
|
18931
|
+
[CountryCodes.Denmark]: simpleBankCodeMetadata(4, "5051"),
|
|
18932
|
+
[CountryCodes.HongKong]: simpleBankCodeMetadata(3, "321", "clearingCode"),
|
|
18933
|
+
[CountryCodes.Norway]: simpleBankCodeMetadata(4, "8601"),
|
|
18934
|
+
// Not yet implemented
|
|
18935
|
+
[CountryCodes.Ecuador]: simpleBankCodeMetadata(4, "1234"),
|
|
18936
|
+
[CountryCodes.Japan]: simpleBankCodeMetadata(4, "1234"),
|
|
18937
|
+
[CountryCodes.Taiwan]: simpleBankCodeMetadata(3, "123")
|
|
18938
|
+
};
|
|
18511
18939
|
const bankCodeFields = ["bankCode"];
|
|
18512
18940
|
function BankCode(props) {
|
|
18513
18941
|
const {
|
|
18514
18942
|
i18n
|
|
18515
18943
|
} = useI18nContext();
|
|
18516
18944
|
const {
|
|
18517
|
-
|
|
18518
|
-
|
|
18945
|
+
country: country2,
|
|
18946
|
+
fieldConfig = defaultFieldConfig$3
|
|
18519
18947
|
} = props;
|
|
18520
|
-
const
|
|
18521
|
-
|
|
18522
|
-
});
|
|
18948
|
+
const metadata = resolveFieldMetadata(fieldConfig[country2], {}, defaultFieldMetadata$3);
|
|
18949
|
+
const mergedProps = mergeFieldMetadataIntoProps("bankCode", metadata, props);
|
|
18523
18950
|
const {
|
|
18524
18951
|
handleChangeFor,
|
|
18525
18952
|
data,
|
|
18526
18953
|
valid,
|
|
18527
18954
|
errors,
|
|
18528
|
-
isValid,
|
|
18529
18955
|
fieldProblems
|
|
18530
18956
|
} = useForm({
|
|
18531
|
-
...
|
|
18957
|
+
...mergedProps,
|
|
18532
18958
|
schema: bankCodeFields,
|
|
18533
|
-
rules: validators,
|
|
18534
|
-
defaultData:
|
|
18535
|
-
fieldProblems:
|
|
18959
|
+
rules: mergedProps.validators,
|
|
18960
|
+
defaultData: mergedProps.data,
|
|
18961
|
+
fieldProblems: mergedProps.fieldValidationErrors
|
|
18536
18962
|
});
|
|
18963
|
+
const {
|
|
18964
|
+
updateStateSlice
|
|
18965
|
+
} = useGlobalDataSlice("payoutAccountDetails", "bankCode");
|
|
18537
18966
|
useEffect(() => {
|
|
18538
|
-
|
|
18539
|
-
|
|
18540
|
-
|
|
18541
|
-
|
|
18542
|
-
|
|
18543
|
-
valid,
|
|
18544
|
-
errors,
|
|
18545
|
-
fieldProblems,
|
|
18546
|
-
caller: "bankCode",
|
|
18547
|
-
dataStoreId
|
|
18548
|
-
}
|
|
18967
|
+
updateStateSlice({
|
|
18968
|
+
data,
|
|
18969
|
+
valid,
|
|
18970
|
+
errors,
|
|
18971
|
+
fieldProblems
|
|
18549
18972
|
});
|
|
18550
|
-
}, [data, valid, errors
|
|
18551
|
-
const formUtils = formUtilities(
|
|
18552
|
-
return
|
|
18553
|
-
|
|
18554
|
-
|
|
18555
|
-
|
|
18556
|
-
|
|
18557
|
-
|
|
18558
|
-
|
|
18559
|
-
|
|
18560
|
-
|
|
18561
|
-
|
|
18562
|
-
|
|
18563
|
-
|
|
18564
|
-
|
|
18565
|
-
|
|
18566
|
-
|
|
18567
|
-
|
|
18568
|
-
|
|
18569
|
-
|
|
18570
|
-
"aria-invalid": !valid.bankCode
|
|
18571
|
-
})
|
|
18572
|
-
})]
|
|
18973
|
+
}, [data, valid, errors]);
|
|
18974
|
+
const formUtils = formUtilities(mergedProps, i18n);
|
|
18975
|
+
return jsx(MaskedInputText, {
|
|
18976
|
+
name: "bankCode",
|
|
18977
|
+
label: formUtils.getLabel("bankCode"),
|
|
18978
|
+
classNameModifiers: {
|
|
18979
|
+
field: ["bankCode"],
|
|
18980
|
+
input: ["bankCode"]
|
|
18981
|
+
},
|
|
18982
|
+
errorMessage: formUtils.getErrorMessage("bankCode", errors, fieldProblems),
|
|
18983
|
+
formatGuidance: formUtils.getGuidanceText("bankCode"),
|
|
18984
|
+
...formUtils.getMask("bankCode"),
|
|
18985
|
+
isValid: valid.bankCode,
|
|
18986
|
+
value: data.bankCode ?? "",
|
|
18987
|
+
readonly: formUtils.isReadOnly("bankCode"),
|
|
18988
|
+
onInput: handleChangeFor("bankCode", "input"),
|
|
18989
|
+
onBlur: handleChangeFor("bankCode", "blur"),
|
|
18990
|
+
"aria-required": true,
|
|
18991
|
+
"aria-label": formUtils.getLabel("bankCode"),
|
|
18992
|
+
"aria-invalid": !valid.bankCode
|
|
18573
18993
|
});
|
|
18574
18994
|
}
|
|
18575
18995
|
const bankNameFields = ["bankName"];
|
|
@@ -18578,18 +18998,13 @@ function BankName(props) {
|
|
|
18578
18998
|
i18n
|
|
18579
18999
|
} = useI18nContext();
|
|
18580
19000
|
const {
|
|
18581
|
-
dataStoreId,
|
|
18582
19001
|
validators
|
|
18583
19002
|
} = props;
|
|
18584
|
-
const stateRef = useRef({
|
|
18585
|
-
setState: null
|
|
18586
|
-
});
|
|
18587
19003
|
const {
|
|
18588
19004
|
handleChangeFor,
|
|
18589
19005
|
data,
|
|
18590
19006
|
valid,
|
|
18591
19007
|
errors,
|
|
18592
|
-
isValid,
|
|
18593
19008
|
fieldProblems
|
|
18594
19009
|
} = useForm({
|
|
18595
19010
|
...props,
|
|
@@ -18598,106 +19013,186 @@ function BankName(props) {
|
|
|
18598
19013
|
defaultData: props.data,
|
|
18599
19014
|
fieldProblems: props == null ? void 0 : props.fieldValidationErrors
|
|
18600
19015
|
});
|
|
19016
|
+
const {
|
|
19017
|
+
updateStateSlice
|
|
19018
|
+
} = useGlobalDataSlice("payoutAccountDetails", "bankName");
|
|
18601
19019
|
useEffect(() => {
|
|
18602
|
-
|
|
18603
|
-
|
|
18604
|
-
|
|
18605
|
-
|
|
18606
|
-
|
|
18607
|
-
valid,
|
|
18608
|
-
errors,
|
|
18609
|
-
fieldProblems,
|
|
18610
|
-
caller: "bankName",
|
|
18611
|
-
dataStoreId
|
|
18612
|
-
}
|
|
19020
|
+
updateStateSlice({
|
|
19021
|
+
data,
|
|
19022
|
+
valid,
|
|
19023
|
+
errors,
|
|
19024
|
+
fieldProblems
|
|
18613
19025
|
});
|
|
18614
|
-
}, [data, valid, errors
|
|
19026
|
+
}, [data, valid, errors]);
|
|
18615
19027
|
const formUtils = formUtilities(props, i18n);
|
|
18616
|
-
return
|
|
18617
|
-
|
|
18618
|
-
|
|
18619
|
-
|
|
19028
|
+
return jsx(Field, {
|
|
19029
|
+
name: "bankName",
|
|
19030
|
+
label: formUtils.getLabel("bankName"),
|
|
19031
|
+
classNameModifiers: ["bankName"],
|
|
19032
|
+
errorMessage: formUtils.getErrorMessage("bankName", errors, fieldProblems),
|
|
19033
|
+
isValid: valid.bankName,
|
|
19034
|
+
children: (childProps) => jsx(InputText, {
|
|
19035
|
+
...childProps,
|
|
18620
19036
|
name: "bankName",
|
|
18621
|
-
|
|
18622
|
-
|
|
18623
|
-
|
|
18624
|
-
|
|
18625
|
-
|
|
18626
|
-
|
|
18627
|
-
|
|
18628
|
-
|
|
18629
|
-
readonly: formUtils.isReadOnly("bankName"),
|
|
18630
|
-
onInput: handleChangeFor("bankName", "input"),
|
|
18631
|
-
onBlur: handleChangeFor("bankName", "blur"),
|
|
18632
|
-
"aria-required": true,
|
|
18633
|
-
"aria-label": formUtils.getLabel("bankName"),
|
|
18634
|
-
"aria-invalid": !valid.bankName
|
|
18635
|
-
})
|
|
18636
|
-
})]
|
|
19037
|
+
value: data.bankName,
|
|
19038
|
+
readonly: formUtils.isReadOnly("bankName"),
|
|
19039
|
+
onInput: handleChangeFor("bankName", "input"),
|
|
19040
|
+
onBlur: handleChangeFor("bankName", "blur"),
|
|
19041
|
+
"aria-required": true,
|
|
19042
|
+
"aria-label": formUtils.getLabel("bankName"),
|
|
19043
|
+
"aria-invalid": !valid.bankName
|
|
19044
|
+
})
|
|
18637
19045
|
});
|
|
18638
19046
|
}
|
|
19047
|
+
const defaultFieldMetadata$2 = {
|
|
19048
|
+
label: "branchCode",
|
|
19049
|
+
validators: isNotEmptyValidator
|
|
19050
|
+
};
|
|
19051
|
+
const defaultFieldConfig$2 = {
|
|
19052
|
+
[CountryCodes.UnitedKingdom]: {
|
|
19053
|
+
label: "sortCode",
|
|
19054
|
+
validators: validatePatternOnBlur(/^\d{6}$/),
|
|
19055
|
+
mask: {
|
|
19056
|
+
mask: makeMask(...numericInputs(6))
|
|
19057
|
+
},
|
|
19058
|
+
guidanceText: {
|
|
19059
|
+
key: "enterNDigitsForExample",
|
|
19060
|
+
values: {
|
|
19061
|
+
numDigits: "6",
|
|
19062
|
+
example: "401199"
|
|
19063
|
+
}
|
|
19064
|
+
}
|
|
19065
|
+
},
|
|
19066
|
+
[CountryCodes.Australia]: {
|
|
19067
|
+
label: "bsbNumber",
|
|
19068
|
+
validators: validatePatternOnBlur(/^\d{6}$/),
|
|
19069
|
+
mask: {
|
|
19070
|
+
mask: makeMask(...numericInputs(3), ...nonInputs(" - "), ...numericInputs(3))
|
|
19071
|
+
},
|
|
19072
|
+
guidanceText: {
|
|
19073
|
+
key: "enterNDigitsForExample",
|
|
19074
|
+
values: {
|
|
19075
|
+
numDigits: "6",
|
|
19076
|
+
example: "033-547"
|
|
19077
|
+
}
|
|
19078
|
+
}
|
|
19079
|
+
},
|
|
19080
|
+
[CountryCodes.Brazil]: {
|
|
19081
|
+
label: "branchCode",
|
|
19082
|
+
validators: validatePatternOnBlur(/^\d{1,5}$/),
|
|
19083
|
+
mask: {
|
|
19084
|
+
mask: makeMask(...numericInputs(1), ...numericInputs(4, true))
|
|
19085
|
+
},
|
|
19086
|
+
guidanceText: {
|
|
19087
|
+
key: "enterAMaximumOfNDigitsForExample",
|
|
19088
|
+
values: {
|
|
19089
|
+
maxDigits: "5",
|
|
19090
|
+
example: "36257"
|
|
19091
|
+
}
|
|
19092
|
+
}
|
|
19093
|
+
},
|
|
19094
|
+
[CountryCodes.Canada]: {
|
|
19095
|
+
label: "transitNumber",
|
|
19096
|
+
validators: validatePatternOnBlur(/^\d{5}$/),
|
|
19097
|
+
mask: {
|
|
19098
|
+
mask: makeMask(...numericInputs(5))
|
|
19099
|
+
},
|
|
19100
|
+
guidanceText: {
|
|
19101
|
+
key: "enterNDigitsForExample",
|
|
19102
|
+
values: {
|
|
19103
|
+
numDigits: "5",
|
|
19104
|
+
example: "27601"
|
|
19105
|
+
}
|
|
19106
|
+
}
|
|
19107
|
+
},
|
|
19108
|
+
[CountryCodes.HongKong]: {
|
|
19109
|
+
label: "branchCode",
|
|
19110
|
+
validators: validatePatternOnBlur(/^\d{3}$/),
|
|
19111
|
+
mask: {
|
|
19112
|
+
mask: makeMask(...numericInputs(3))
|
|
19113
|
+
},
|
|
19114
|
+
guidanceText: {
|
|
19115
|
+
key: "enterNDigitsForExample",
|
|
19116
|
+
values: {
|
|
19117
|
+
numDigits: "3",
|
|
19118
|
+
example: "100"
|
|
19119
|
+
}
|
|
19120
|
+
}
|
|
19121
|
+
},
|
|
19122
|
+
[CountryCodes.UnitedStates]: {
|
|
19123
|
+
label: "achRoutingNumber",
|
|
19124
|
+
validators: validatePatternOnBlur(/^\d{9}$/),
|
|
19125
|
+
mask: {
|
|
19126
|
+
mask: makeMask(...numericInputs(9))
|
|
19127
|
+
},
|
|
19128
|
+
guidanceText: {
|
|
19129
|
+
key: "enterNDigitsForExample",
|
|
19130
|
+
values: {
|
|
19131
|
+
numDigits: "9",
|
|
19132
|
+
example: "107005432"
|
|
19133
|
+
}
|
|
19134
|
+
}
|
|
19135
|
+
},
|
|
19136
|
+
// Not yet implemented
|
|
19137
|
+
[CountryCodes.Indonesia]: {
|
|
19138
|
+
label: "clearingCode",
|
|
19139
|
+
validators: isNotEmptyValidator
|
|
19140
|
+
}
|
|
19141
|
+
};
|
|
18639
19142
|
const branchCodeFields = ["branchCode"];
|
|
18640
19143
|
function BranchCode(props) {
|
|
18641
19144
|
const {
|
|
18642
19145
|
i18n
|
|
18643
19146
|
} = useI18nContext();
|
|
18644
19147
|
const {
|
|
18645
|
-
|
|
18646
|
-
|
|
19148
|
+
country: country2,
|
|
19149
|
+
fieldConfig = defaultFieldConfig$2
|
|
18647
19150
|
} = props;
|
|
18648
|
-
const
|
|
18649
|
-
|
|
18650
|
-
});
|
|
19151
|
+
const metadata = resolveFieldMetadata(fieldConfig[country2], {}, defaultFieldMetadata$2);
|
|
19152
|
+
const mergedProps = mergeFieldMetadataIntoProps("branchCode", metadata, props);
|
|
18651
19153
|
const {
|
|
18652
19154
|
handleChangeFor,
|
|
18653
19155
|
data,
|
|
18654
19156
|
valid,
|
|
18655
19157
|
errors,
|
|
18656
|
-
isValid,
|
|
18657
19158
|
fieldProblems
|
|
18658
19159
|
} = useForm({
|
|
18659
|
-
...
|
|
19160
|
+
...mergedProps,
|
|
18660
19161
|
schema: branchCodeFields,
|
|
18661
|
-
rules: validators,
|
|
18662
|
-
defaultData:
|
|
18663
|
-
fieldProblems:
|
|
19162
|
+
rules: mergedProps.validators,
|
|
19163
|
+
defaultData: mergedProps.data,
|
|
19164
|
+
fieldProblems: mergedProps == null ? void 0 : mergedProps.fieldValidationErrors
|
|
18664
19165
|
});
|
|
19166
|
+
const {
|
|
19167
|
+
updateStateSlice
|
|
19168
|
+
} = useGlobalDataSlice("payoutAccountDetails", "branchCode");
|
|
18665
19169
|
useEffect(() => {
|
|
18666
|
-
|
|
18667
|
-
|
|
18668
|
-
|
|
18669
|
-
|
|
18670
|
-
|
|
18671
|
-
valid,
|
|
18672
|
-
errors,
|
|
18673
|
-
fieldProblems,
|
|
18674
|
-
caller: "branchCode",
|
|
18675
|
-
dataStoreId
|
|
18676
|
-
}
|
|
19170
|
+
updateStateSlice({
|
|
19171
|
+
data,
|
|
19172
|
+
valid,
|
|
19173
|
+
errors,
|
|
19174
|
+
fieldProblems
|
|
18677
19175
|
});
|
|
18678
|
-
}, [data, valid, errors
|
|
18679
|
-
const formUtils = formUtilities(
|
|
18680
|
-
return
|
|
18681
|
-
|
|
18682
|
-
|
|
18683
|
-
|
|
18684
|
-
|
|
18685
|
-
|
|
18686
|
-
|
|
18687
|
-
|
|
18688
|
-
|
|
18689
|
-
|
|
18690
|
-
|
|
18691
|
-
|
|
18692
|
-
|
|
18693
|
-
|
|
18694
|
-
|
|
18695
|
-
|
|
18696
|
-
|
|
18697
|
-
|
|
18698
|
-
"aria-invalid": !valid.branchCode
|
|
18699
|
-
})
|
|
18700
|
-
})]
|
|
19176
|
+
}, [data, valid, errors]);
|
|
19177
|
+
const formUtils = formUtilities(mergedProps, i18n);
|
|
19178
|
+
return jsx(MaskedInputText, {
|
|
19179
|
+
name: "branchCode",
|
|
19180
|
+
label: formUtils.getLabel("branchCode"),
|
|
19181
|
+
formatGuidance: formUtils.getGuidanceText("branchCode"),
|
|
19182
|
+
...formUtils.getMask("branchCode"),
|
|
19183
|
+
classNameModifiers: {
|
|
19184
|
+
field: ["branchCode"],
|
|
19185
|
+
input: ["branchCode"]
|
|
19186
|
+
},
|
|
19187
|
+
errorMessage: formUtils.getErrorMessage("branchCode", errors, fieldProblems),
|
|
19188
|
+
isValid: valid.branchCode,
|
|
19189
|
+
value: data.branchCode ?? "",
|
|
19190
|
+
readonly: formUtils.isReadOnly("branchCode"),
|
|
19191
|
+
onInput: handleChangeFor("branchCode", "input"),
|
|
19192
|
+
onBlur: handleChangeFor("branchCode", "blur"),
|
|
19193
|
+
"aria-required": true,
|
|
19194
|
+
"aria-label": formUtils.getLabel("branchCode"),
|
|
19195
|
+
"aria-invalid": !valid.branchCode
|
|
18701
19196
|
});
|
|
18702
19197
|
}
|
|
18703
19198
|
const currencyFields = ["currency"];
|
|
@@ -18767,23 +19262,25 @@ const bbanPatternsByCountry = {
|
|
|
18767
19262
|
GB: /[A-Z]{4}\d{14}/,
|
|
18768
19263
|
VG: /[\dA-Z]{4}\d{16}/
|
|
18769
19264
|
};
|
|
18770
|
-
const
|
|
18771
|
-
|
|
19265
|
+
const customPrefixByCountry = {
|
|
19266
|
+
[CountryCodes.Guernsey]: "GB",
|
|
19267
|
+
[CountryCodes.Jersey]: "GB",
|
|
19268
|
+
[CountryCodes.IsleOfMan]: "GB"
|
|
18772
19269
|
};
|
|
18773
|
-
function ibanValidator(input,
|
|
18774
|
-
var _a;
|
|
19270
|
+
function ibanValidator(input, bankCountry2) {
|
|
18775
19271
|
if (isEmpty(input))
|
|
18776
|
-
return
|
|
19272
|
+
return false;
|
|
18777
19273
|
const ibanInput = input.replace(/ /g, "").toUpperCase();
|
|
18778
19274
|
if (!/^([a-zA-Z0-9]{4} ){2,8}[a-zA-Z0-9]{1,4}|[a-zA-Z0-9]{12,34}$/.test(ibanInput)) {
|
|
18779
|
-
return
|
|
19275
|
+
return false;
|
|
18780
19276
|
}
|
|
18781
19277
|
const countryCode = ibanInput.substring(0, 2);
|
|
18782
|
-
|
|
19278
|
+
const allowedPrefix = customPrefixByCountry[bankCountry2] ?? bankCountry2;
|
|
19279
|
+
if (countryCode !== allowedPrefix) {
|
|
18783
19280
|
return {
|
|
18784
19281
|
key: "yourIbanShouldBeginWith_",
|
|
18785
19282
|
values: {
|
|
18786
|
-
countryCode:
|
|
19283
|
+
countryCode: allowedPrefix
|
|
18787
19284
|
}
|
|
18788
19285
|
};
|
|
18789
19286
|
}
|
|
@@ -18791,7 +19288,7 @@ function ibanValidator(input, bankCountries) {
|
|
|
18791
19288
|
if (bbanPattern) {
|
|
18792
19289
|
const ibanPattern = new RegExp(`^[A-Z]{2}\\d{2}${bbanPattern.source}$`, "");
|
|
18793
19290
|
if (!ibanPattern.test(ibanInput)) {
|
|
18794
|
-
return
|
|
19291
|
+
return false;
|
|
18795
19292
|
}
|
|
18796
19293
|
}
|
|
18797
19294
|
const ibanCheck = ibanInput.substring(4, ibanInput.length) + ibanInput.substring(0, 4);
|
|
@@ -18806,39 +19303,135 @@ function ibanValidator(input, bankCountries) {
|
|
|
18806
19303
|
ibanCheckDigits += "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(charAt);
|
|
18807
19304
|
}
|
|
18808
19305
|
}
|
|
18809
|
-
let cRest = 0;
|
|
18810
|
-
for (let p = 0; p < ibanCheckDigits.length; p += 1) {
|
|
18811
|
-
const cChar = ibanCheckDigits.charAt(p);
|
|
18812
|
-
const cOperator = +`${cRest}${cChar}`;
|
|
18813
|
-
cRest = cOperator % 97;
|
|
19306
|
+
let cRest = 0;
|
|
19307
|
+
for (let p = 0; p < ibanCheckDigits.length; p += 1) {
|
|
19308
|
+
const cChar = ibanCheckDigits.charAt(p);
|
|
19309
|
+
const cOperator = +`${cRest}${cChar}`;
|
|
19310
|
+
cRest = cOperator % 97;
|
|
19311
|
+
}
|
|
19312
|
+
return cRest === 1;
|
|
19313
|
+
}
|
|
19314
|
+
const validateIbanOnBlurAndInput = (country2) => ({
|
|
19315
|
+
modes: ["blur", "input"],
|
|
19316
|
+
validate: (iban2) => ibanValidator(iban2, country2) === true,
|
|
19317
|
+
errorMessage: (iban2) => {
|
|
19318
|
+
const result = ibanValidator(iban2, country2);
|
|
19319
|
+
return typeof result === "boolean" ? void 0 : result;
|
|
19320
|
+
}
|
|
19321
|
+
});
|
|
19322
|
+
const ibanMask = (country2, inputLength, includesBankCode) => {
|
|
19323
|
+
const tokens = [];
|
|
19324
|
+
tokens.push(...nonInputs(country2, {
|
|
19325
|
+
includeInValue: true
|
|
19326
|
+
}), ...numericInputs(2), spacer);
|
|
19327
|
+
inputLength -= 2;
|
|
19328
|
+
if (includesBankCode) {
|
|
19329
|
+
tokens.push(...alphaInputs(4), spacer);
|
|
19330
|
+
inputLength -= 4;
|
|
19331
|
+
}
|
|
19332
|
+
const numGroups = Math.floor(inputLength / 4);
|
|
19333
|
+
const remainder = inputLength % 4;
|
|
19334
|
+
for (let i = 0; i < numGroups; i += 1) {
|
|
19335
|
+
tokens.push(...numericInputs(4), spacer);
|
|
19336
|
+
}
|
|
19337
|
+
tokens.push(...numericInputs(remainder));
|
|
19338
|
+
return {
|
|
19339
|
+
mask: {
|
|
19340
|
+
tokens
|
|
19341
|
+
},
|
|
19342
|
+
transformOnType: includesBankCode ? uppercase : void 0
|
|
19343
|
+
};
|
|
19344
|
+
};
|
|
19345
|
+
const ibanGuidance = (type, numDigitsOrChars, example) => type === "digits" ? {
|
|
19346
|
+
key: "enterTheRemainingNDigitsForExample",
|
|
19347
|
+
values: {
|
|
19348
|
+
numDigits: `${numDigitsOrChars}`,
|
|
19349
|
+
example
|
|
19350
|
+
}
|
|
19351
|
+
} : {
|
|
19352
|
+
key: "enterTheRemainingNCharactersForExample",
|
|
19353
|
+
values: {
|
|
19354
|
+
numChars: `${numDigitsOrChars}`,
|
|
19355
|
+
example
|
|
18814
19356
|
}
|
|
18815
|
-
|
|
18816
|
-
|
|
18817
|
-
|
|
18818
|
-
|
|
18819
|
-
|
|
19357
|
+
};
|
|
19358
|
+
const ibanMetadata = (country2, inputLength, example, includesBankCode) => ({
|
|
19359
|
+
label: "iban",
|
|
19360
|
+
validators: validateIbanOnBlurAndInput(country2),
|
|
19361
|
+
mask: ibanMask(country2, inputLength, includesBankCode),
|
|
19362
|
+
guidanceText: ibanGuidance(includesBankCode ? "characters" : "digits", inputLength, example)
|
|
19363
|
+
});
|
|
19364
|
+
const gbIbanMetadata = ibanMetadata(CountryCodes.UnitedKingdom, 20, "GB09 BARC 2003 9554 8297 59", true);
|
|
19365
|
+
const defaultFieldMetadata$1 = {
|
|
19366
|
+
label: "iban",
|
|
19367
|
+
validators: isNotEmptyValidator
|
|
19368
|
+
};
|
|
19369
|
+
const defaultFieldConfig$1 = {
|
|
19370
|
+
[CountryCodes.Austria]: ibanMetadata(CountryCodes.Austria, 18, "AT88 5400 0746 7265 9747"),
|
|
19371
|
+
[CountryCodes.Belgium]: ibanMetadata(CountryCodes.Belgium, 14, "BE59 9788 6743 2226"),
|
|
19372
|
+
[CountryCodes.Croatia]: ibanMetadata(CountryCodes.Croatia, 19, "HR51 2484 0083 5929 6973 8"),
|
|
19373
|
+
[CountryCodes.Cyprus]: ibanMetadata(CountryCodes.Cyprus, 26, "CY16 5183 1221 8756 5858 5388 7678"),
|
|
19374
|
+
[CountryCodes.CzechRepublic]: ibanMetadata(CountryCodes.CzechRepublic, 22, "CZ23 5051 3674 5924 5233 3465"),
|
|
19375
|
+
[CountryCodes.Estonia]: ibanMetadata(CountryCodes.Estonia, 18, "EE26 1291 5123 1542 6371"),
|
|
19376
|
+
[CountryCodes.Finland]: ibanMetadata(CountryCodes.Finland, 16, "FI03 9319 8995 3742 51"),
|
|
19377
|
+
[CountryCodes.Germany]: ibanMetadata(CountryCodes.Germany, 20, "DE91 1000 0000 0123 4567 89"),
|
|
19378
|
+
[CountryCodes.Greece]: ibanMetadata(CountryCodes.Greece, 25, "GR57 0107 7142 7681 6687 9575 217"),
|
|
19379
|
+
[CountryCodes.Hungary]: ibanMetadata(CountryCodes.Hungary, 26, "HU68 1070 0024 3428 4128 3192 4812"),
|
|
19380
|
+
[CountryCodes.Italy]: ibanMetadata(CountryCodes.Italy, 25, "IT06 L030 0203 2809 8485 8934 882"),
|
|
19381
|
+
[CountryCodes.Lithuania]: ibanMetadata(CountryCodes.Lithuania, 18, "LT59 9244 6228 2176 2762"),
|
|
19382
|
+
[CountryCodes.Luxembourg]: ibanMetadata(CountryCodes.Luxembourg, 18, "LU71 0106 9242 5365 8562"),
|
|
19383
|
+
[CountryCodes.Monaco]: ibanMetadata(CountryCodes.Monaco, 25, "MC58 1122 2000 0101 2345 6789 030"),
|
|
19384
|
+
[CountryCodes.Portugal]: ibanMetadata(CountryCodes.Portugal, 23, "PT42 0035 0651 8646 9119 5263 5"),
|
|
19385
|
+
[CountryCodes.Slovakia]: ibanMetadata(CountryCodes.Slovakia, 22, "SK25 5173 1333 4916 3219 3521"),
|
|
19386
|
+
[CountryCodes.Spain]: ibanMetadata(CountryCodes.Spain, 22, "ES76 1465 5599 9226 7623 2635"),
|
|
19387
|
+
// These include 4-letter bank codes
|
|
19388
|
+
[CountryCodes.Bulgaria]: ibanMetadata(CountryCodes.Bulgaria, 20, "BG03 BNJE 8736 1280 1193 83", true),
|
|
19389
|
+
[CountryCodes.Gibraltar]: ibanMetadata(CountryCodes.Gibraltar, 21, "GI75 HYKN 0120 0320 7038 453", true),
|
|
19390
|
+
[CountryCodes.Ireland]: ibanMetadata(CountryCodes.Ireland, 20, "IE64 IRCE 9205 0112 3456 78", true),
|
|
19391
|
+
[CountryCodes.Latvia]: ibanMetadata(CountryCodes.Latvia, 19, "LV80 BANK 0000 4351 9500 1", true),
|
|
19392
|
+
[CountryCodes.Malta]: ibanMetadata(CountryCodes.Malta, 29, "MT03 VIXW 2487 8926 8575 8586 8929 858", true),
|
|
19393
|
+
[CountryCodes.Netherlands]: ibanMetadata(CountryCodes.Netherlands, 16, "NL50 ABNA 4452 7591 49", true),
|
|
19394
|
+
[CountryCodes.Romania]: ibanMetadata(CountryCodes.Romania, 22, "RO36 PORL 9596 9966 4965 4284", true),
|
|
19395
|
+
[CountryCodes.UnitedKingdom]: gbIbanMetadata,
|
|
19396
|
+
// IBANs for Guernsey, Jersey, and Isle of Man also use United Kingdom's format (starting with `GB`)
|
|
19397
|
+
[CountryCodes.Guernsey]: gbIbanMetadata,
|
|
19398
|
+
[CountryCodes.Jersey]: gbIbanMetadata,
|
|
19399
|
+
[CountryCodes.IsleOfMan]: gbIbanMetadata,
|
|
19400
|
+
// These are a little bit different
|
|
19401
|
+
[CountryCodes.France]: {
|
|
19402
|
+
label: "iban",
|
|
19403
|
+
validators: validateIbanOnBlurAndInput(CountryCodes.France),
|
|
19404
|
+
mask: {
|
|
19405
|
+
mask: makeMask(...nonInputs("FR", {
|
|
19406
|
+
includeInValue: true
|
|
19407
|
+
}), ...numericInputs(2), spacer, ...numericInputs(4), spacer, ...numericInputs(4), spacer, ...numericInputs(4), spacer, ...numericInputs(4), spacer, ...numericInputs(4), spacer, ...alphaInputs(1), ...numericInputs(2)),
|
|
19408
|
+
transformOnType: uppercase
|
|
19409
|
+
},
|
|
19410
|
+
guidanceText: ibanGuidance("characters", 25, "FR64 1009 6000 4035 3425 9742 Y90")
|
|
19411
|
+
},
|
|
19412
|
+
[CountryCodes.Liechtenstein]: {
|
|
19413
|
+
label: "iban",
|
|
19414
|
+
validators: validateIbanOnBlurAndInput(CountryCodes.Liechtenstein),
|
|
19415
|
+
mask: {
|
|
19416
|
+
mask: makeMask(...nonInputs("LT", {
|
|
19417
|
+
includeInValue: true
|
|
19418
|
+
}), ...numericInputs(2), spacer, ...numericInputs(4), spacer, ...numericInputs(4), spacer, ...numericInputs(4), spacer, ...numericInputs(3), ...alphaInputs(1), spacer, ...alphaInputs(1)),
|
|
19419
|
+
transformOnType: uppercase
|
|
19420
|
+
},
|
|
19421
|
+
guidanceText: ibanGuidance("characters", 19, "LI21 0881 0000 2324 013A A")
|
|
18820
19422
|
}
|
|
18821
19423
|
};
|
|
18822
19424
|
const ibanFields = ["iban"];
|
|
18823
|
-
const addCountryValidationForIban = (allowedCountries) => ({
|
|
18824
|
-
iban: [{
|
|
18825
|
-
modes: ["blur", "input"],
|
|
18826
|
-
validate: (iban2) => ibanValidator(iban2, allowedCountries) === void 0,
|
|
18827
|
-
errorMessage: (iban2) => ibanValidator(iban2, allowedCountries)
|
|
18828
|
-
}]
|
|
18829
|
-
});
|
|
18830
19425
|
function Iban(props) {
|
|
18831
19426
|
const {
|
|
18832
19427
|
i18n
|
|
18833
19428
|
} = useI18nContext();
|
|
18834
19429
|
const {
|
|
18835
|
-
|
|
18836
|
-
|
|
19430
|
+
country: country2,
|
|
19431
|
+
fieldConfig = defaultFieldConfig$1
|
|
18837
19432
|
} = props;
|
|
18838
|
-
const
|
|
18839
|
-
|
|
18840
|
-
});
|
|
18841
|
-
const rules2 = useMemo(() => addCountryValidationForIban([country2]), [country2]);
|
|
19433
|
+
const metadata = resolveFieldMetadata(fieldConfig[country2], {}, defaultFieldMetadata$1);
|
|
19434
|
+
const mergedProps = mergeFieldMetadataIntoProps("iban", metadata, props);
|
|
18842
19435
|
const {
|
|
18843
19436
|
handleChangeFor,
|
|
18844
19437
|
data,
|
|
@@ -18846,115 +19439,111 @@ function Iban(props) {
|
|
|
18846
19439
|
errors,
|
|
18847
19440
|
fieldProblems
|
|
18848
19441
|
} = useForm({
|
|
18849
|
-
...
|
|
19442
|
+
...mergedProps,
|
|
18850
19443
|
schema: ibanFields,
|
|
18851
|
-
rules:
|
|
19444
|
+
rules: mergedProps.validators,
|
|
18852
19445
|
defaultData: props.data,
|
|
18853
|
-
formatters: ibanFormatter,
|
|
18854
19446
|
fieldProblems: props == null ? void 0 : props.fieldValidationErrors,
|
|
18855
|
-
|
|
19447
|
+
obscuredFields: props.obscuredFields
|
|
18856
19448
|
});
|
|
19449
|
+
const {
|
|
19450
|
+
updateStateSlice
|
|
19451
|
+
} = useGlobalDataSlice("payoutAccountDetails", "iban");
|
|
18857
19452
|
useEffect(() => {
|
|
18858
|
-
|
|
18859
|
-
|
|
18860
|
-
|
|
18861
|
-
|
|
18862
|
-
|
|
18863
|
-
valid,
|
|
18864
|
-
errors,
|
|
18865
|
-
fieldProblems,
|
|
18866
|
-
caller: "iban",
|
|
18867
|
-
dataStoreId
|
|
18868
|
-
}
|
|
19453
|
+
updateStateSlice({
|
|
19454
|
+
data,
|
|
19455
|
+
valid,
|
|
19456
|
+
errors,
|
|
19457
|
+
fieldProblems
|
|
18869
19458
|
});
|
|
18870
19459
|
}, [data, errors, valid]);
|
|
18871
|
-
const formUtils = formUtilities(
|
|
18872
|
-
return
|
|
18873
|
-
|
|
18874
|
-
|
|
18875
|
-
|
|
18876
|
-
|
|
18877
|
-
|
|
18878
|
-
|
|
18879
|
-
|
|
18880
|
-
|
|
18881
|
-
|
|
18882
|
-
|
|
18883
|
-
|
|
18884
|
-
|
|
18885
|
-
|
|
18886
|
-
|
|
18887
|
-
|
|
18888
|
-
|
|
18889
|
-
|
|
18890
|
-
|
|
18891
|
-
transformInput: (value) => value.toUpperCase()
|
|
18892
|
-
})
|
|
18893
|
-
})]
|
|
19460
|
+
const formUtils = formUtilities(mergedProps, i18n);
|
|
19461
|
+
return jsx(MaskedInputText, {
|
|
19462
|
+
name: "iban",
|
|
19463
|
+
label: formUtils.getLabel("iban"),
|
|
19464
|
+
formatGuidance: formUtils.getGuidanceText("iban"),
|
|
19465
|
+
...formUtils.getMask("iban"),
|
|
19466
|
+
errorMessage: formUtils.getErrorMessage("iban", errors, fieldProblems),
|
|
19467
|
+
isValid: valid.iban,
|
|
19468
|
+
value: data.iban ?? "",
|
|
19469
|
+
readonly: formUtils.isReadOnly("iban"),
|
|
19470
|
+
classNameModifiers: {
|
|
19471
|
+
field: ["iban"],
|
|
19472
|
+
input: ["iban"]
|
|
19473
|
+
},
|
|
19474
|
+
onInput: handleChangeFor("iban", "blur"),
|
|
19475
|
+
onBlur: handleChangeFor("iban", "blur"),
|
|
19476
|
+
"aria-required": true,
|
|
19477
|
+
"aria-label": formUtils.getLabel("iban"),
|
|
19478
|
+
"aria-invalid": !valid.iban,
|
|
19479
|
+
acceptObscuredValue: formUtils.isObscured("iban")
|
|
18894
19480
|
});
|
|
18895
19481
|
}
|
|
19482
|
+
const swiftCodeFieldMetadata = {
|
|
19483
|
+
label: "bicSwift",
|
|
19484
|
+
validators: validatePatternOnBlur(/^([a-zA-Z0-9]{8}|[a-zA-Z0-9]{11})$/),
|
|
19485
|
+
mask: {
|
|
19486
|
+
mask: makeMask(...alphaInputs(6), ...alphanumericInputs(2), ...alphanumericInputs(3, true)),
|
|
19487
|
+
transformOnType: uppercase
|
|
19488
|
+
},
|
|
19489
|
+
guidanceText: {
|
|
19490
|
+
key: "enterXOrYCharactersForExample",
|
|
19491
|
+
values: {
|
|
19492
|
+
xChars: "8",
|
|
19493
|
+
yChars: "11",
|
|
19494
|
+
example: "BANKDE65287"
|
|
19495
|
+
}
|
|
19496
|
+
}
|
|
19497
|
+
};
|
|
18896
19498
|
const swiftCodeFields = ["swiftCode"];
|
|
18897
19499
|
function SwiftCode(props) {
|
|
18898
19500
|
const {
|
|
18899
19501
|
i18n
|
|
18900
19502
|
} = useI18nContext();
|
|
18901
|
-
const
|
|
18902
|
-
dataStoreId,
|
|
18903
|
-
validators
|
|
18904
|
-
} = props;
|
|
18905
|
-
const stateRef = useRef({
|
|
18906
|
-
setState: null
|
|
18907
|
-
});
|
|
19503
|
+
const mergedProps = mergeFieldMetadataIntoProps("swiftCode", swiftCodeFieldMetadata, props);
|
|
18908
19504
|
const {
|
|
18909
19505
|
handleChangeFor,
|
|
18910
19506
|
data,
|
|
18911
19507
|
valid,
|
|
18912
19508
|
errors,
|
|
18913
|
-
isValid,
|
|
18914
19509
|
fieldProblems
|
|
18915
19510
|
} = useForm({
|
|
18916
|
-
...
|
|
19511
|
+
...mergedProps,
|
|
18917
19512
|
schema: swiftCodeFields,
|
|
18918
|
-
rules: validators,
|
|
18919
|
-
defaultData:
|
|
18920
|
-
fieldProblems:
|
|
19513
|
+
rules: mergedProps.validators,
|
|
19514
|
+
defaultData: mergedProps.data,
|
|
19515
|
+
fieldProblems: mergedProps == null ? void 0 : mergedProps.fieldValidationErrors
|
|
18921
19516
|
});
|
|
19517
|
+
const {
|
|
19518
|
+
updateStateSlice
|
|
19519
|
+
} = useGlobalDataSlice("payoutAccountDetails", "swiftCode");
|
|
18922
19520
|
useEffect(() => {
|
|
18923
|
-
|
|
18924
|
-
|
|
18925
|
-
|
|
18926
|
-
|
|
18927
|
-
|
|
18928
|
-
valid,
|
|
18929
|
-
errors,
|
|
18930
|
-
fieldProblems,
|
|
18931
|
-
caller: "swiftCode",
|
|
18932
|
-
dataStoreId
|
|
18933
|
-
}
|
|
19521
|
+
updateStateSlice({
|
|
19522
|
+
data,
|
|
19523
|
+
valid,
|
|
19524
|
+
errors,
|
|
19525
|
+
fieldProblems
|
|
18934
19526
|
});
|
|
18935
|
-
}, [data, valid, errors
|
|
18936
|
-
const formUtils = formUtilities(
|
|
18937
|
-
return
|
|
18938
|
-
|
|
18939
|
-
|
|
18940
|
-
|
|
18941
|
-
|
|
18942
|
-
|
|
18943
|
-
|
|
18944
|
-
|
|
18945
|
-
|
|
18946
|
-
|
|
18947
|
-
|
|
18948
|
-
|
|
18949
|
-
|
|
18950
|
-
|
|
18951
|
-
|
|
18952
|
-
|
|
18953
|
-
|
|
18954
|
-
|
|
18955
|
-
"aria-invalid": !valid.swiftCode
|
|
18956
|
-
})
|
|
18957
|
-
})]
|
|
19527
|
+
}, [data, valid, errors]);
|
|
19528
|
+
const formUtils = formUtilities(mergedProps, i18n);
|
|
19529
|
+
return jsx(MaskedInputText, {
|
|
19530
|
+
name: "swiftCode",
|
|
19531
|
+
label: formUtils.getLabel("swiftCode"),
|
|
19532
|
+
formatGuidance: formUtils.getGuidanceText("swiftCode"),
|
|
19533
|
+
...formUtils.getMask("swiftCode"),
|
|
19534
|
+
classNameModifiers: {
|
|
19535
|
+
field: ["swiftCode"],
|
|
19536
|
+
input: ["swiftCode"]
|
|
19537
|
+
},
|
|
19538
|
+
errorMessage: formUtils.getErrorMessage("swiftCode", errors, fieldProblems),
|
|
19539
|
+
isValid: valid.swiftCode,
|
|
19540
|
+
value: data.swiftCode ?? "",
|
|
19541
|
+
readonly: formUtils.isReadOnly("swiftCode"),
|
|
19542
|
+
onInput: handleChangeFor("swiftCode", "input"),
|
|
19543
|
+
onBlur: handleChangeFor("swiftCode", "blur"),
|
|
19544
|
+
"aria-required": true,
|
|
19545
|
+
"aria-label": formUtils.getLabel("swiftCode"),
|
|
19546
|
+
"aria-invalid": !valid.swiftCode
|
|
18958
19547
|
});
|
|
18959
19548
|
}
|
|
18960
19549
|
const payoutAccountFields = ["accountHolder", ...ibanFields, ...branchCodeFields, ...swiftCodeFields, ...currencyFields, ...bankAccountNumberFields, ...bankNameFields, ...bankCodeFields];
|
|
@@ -18979,14 +19568,10 @@ function PayoutAccountComponent(props) {
|
|
|
18979
19568
|
arePayoutAccountDetailsInvalid,
|
|
18980
19569
|
invalidFieldNames
|
|
18981
19570
|
} = props;
|
|
18982
|
-
const stateRef = useRef({
|
|
18983
|
-
setState: null
|
|
18984
|
-
});
|
|
18985
19571
|
const {
|
|
18986
19572
|
data,
|
|
18987
19573
|
valid,
|
|
18988
19574
|
errors,
|
|
18989
|
-
isValid,
|
|
18990
19575
|
handleChangeFor,
|
|
18991
19576
|
schema
|
|
18992
19577
|
} = useForm({
|
|
@@ -19000,20 +19585,17 @@ function PayoutAccountComponent(props) {
|
|
|
19000
19585
|
...props,
|
|
19001
19586
|
requiredFields
|
|
19002
19587
|
}, i18n);
|
|
19588
|
+
const {
|
|
19589
|
+
updateStateSlice
|
|
19590
|
+
} = useGlobalDataSlice("payoutAccountDetails");
|
|
19003
19591
|
useEffect(() => {
|
|
19004
|
-
|
|
19005
|
-
|
|
19006
|
-
|
|
19007
|
-
|
|
19008
|
-
|
|
19009
|
-
valid,
|
|
19010
|
-
errors,
|
|
19011
|
-
caller: id2,
|
|
19012
|
-
dataStoreId: id2,
|
|
19013
|
-
schema
|
|
19014
|
-
}
|
|
19592
|
+
updateStateSlice({
|
|
19593
|
+
data,
|
|
19594
|
+
valid,
|
|
19595
|
+
errors,
|
|
19596
|
+
schema
|
|
19015
19597
|
});
|
|
19016
|
-
}, [data, valid, errors
|
|
19598
|
+
}, [data, valid, errors]);
|
|
19017
19599
|
const bankAccountNumberProps = getFieldProps(props, bankAccountNumberFields);
|
|
19018
19600
|
const swiftCodeProps = getFieldProps(props, swiftCodeFields);
|
|
19019
19601
|
const ibanProps = getFieldProps(props, ibanFields);
|
|
@@ -19027,10 +19609,7 @@ function PayoutAccountComponent(props) {
|
|
|
19027
19609
|
return jsxs("form", {
|
|
19028
19610
|
className: "adyen-kyc-individual__payout-account",
|
|
19029
19611
|
"aria-describedby": "ariaErrorField",
|
|
19030
|
-
children: [jsx(
|
|
19031
|
-
owner: id2,
|
|
19032
|
-
stateRef
|
|
19033
|
-
}), jsx(FormHeader, {
|
|
19612
|
+
children: [jsx(FormHeader, {
|
|
19034
19613
|
heading: props.heading
|
|
19035
19614
|
}), jsx(ErrorPanel, {
|
|
19036
19615
|
verificationErrors: props == null ? void 0 : props.formVerificationErrors,
|
|
@@ -19080,9 +19659,11 @@ function PayoutAccountComponent(props) {
|
|
|
19080
19659
|
dataStoreId: id2
|
|
19081
19660
|
}), formUtils.isRequiredField("bankCode") && jsx(BankCode, {
|
|
19082
19661
|
...bankCodeProps,
|
|
19662
|
+
country: country2,
|
|
19083
19663
|
dataStoreId: id2
|
|
19084
19664
|
}), formUtils.isRequiredField("branchCode") && jsx(BranchCode, {
|
|
19085
19665
|
...branchCodeProps,
|
|
19666
|
+
country: country2,
|
|
19086
19667
|
dataStoreId: id2
|
|
19087
19668
|
}), formUtils.isRequiredField("bankCity") && jsx(BankCity, {
|
|
19088
19669
|
...bankCityProps,
|
|
@@ -20082,7 +20663,7 @@ function PayoutDetailsComponent(props) {
|
|
|
20082
20663
|
useEffect(() => {
|
|
20083
20664
|
var _a2;
|
|
20084
20665
|
if (validateAccountDetails && ((_a2 = validateAccountDetails.invalidFields) == null ? void 0 : _a2.length) > 0) {
|
|
20085
|
-
const fieldNames = validateAccountDetails.invalidFields.map((field) => extractFieldName(field == null ? void 0 : field.name)).map((key) =>
|
|
20666
|
+
const fieldNames = validateAccountDetails.invalidFields.map((field) => extractFieldName(field == null ? void 0 : field.name)).map((key) => i18n.get(key));
|
|
20086
20667
|
const invalidFieldsString = concatenateFieldNames(fieldNames);
|
|
20087
20668
|
setInvalidFieldNames(invalidFieldsString);
|
|
20088
20669
|
setArePayoutAccountDetailsInvalid(true);
|
|
@@ -21784,28 +22365,18 @@ const payoutFieldsMapping = {
|
|
|
21784
22365
|
OWNER_NAME: "accountHolder",
|
|
21785
22366
|
BANK_NAME: "bankName"
|
|
21786
22367
|
};
|
|
21787
|
-
const
|
|
22368
|
+
const obscuredPayoutFields = [payoutFieldsMapping.NUMBER, payoutFieldsMapping.IBAN];
|
|
21788
22369
|
const countryConfig$2 = {
|
|
21789
|
-
[CountryCodes.Australia]: {
|
|
21790
|
-
branchCode: {
|
|
21791
|
-
label: "bsbNumber"
|
|
21792
|
-
}
|
|
21793
|
-
},
|
|
22370
|
+
[CountryCodes.Australia]: {},
|
|
21794
22371
|
[CountryCodes.Brazil]: {
|
|
21795
22372
|
bankCode: {
|
|
21796
22373
|
label: "bankCode"
|
|
21797
|
-
},
|
|
21798
|
-
branchCode: {
|
|
21799
|
-
label: "branchCode"
|
|
21800
22374
|
}
|
|
21801
22375
|
},
|
|
21802
22376
|
[CountryCodes.Canada]: {
|
|
21803
22377
|
bankCode: {
|
|
21804
22378
|
label: "institutionNumber"
|
|
21805
22379
|
},
|
|
21806
|
-
branchCode: {
|
|
21807
|
-
label: "transitNumber"
|
|
21808
|
-
},
|
|
21809
22380
|
bankStatementDocument: {
|
|
21810
22381
|
label: "listitemVoidedChequeBankLetterBankStatementOnline"
|
|
21811
22382
|
}
|
|
@@ -21813,39 +22384,23 @@ const countryConfig$2 = {
|
|
|
21813
22384
|
[CountryCodes.HongKong]: {
|
|
21814
22385
|
bankCode: {
|
|
21815
22386
|
label: "clearingCode"
|
|
21816
|
-
},
|
|
21817
|
-
branchCode: {
|
|
21818
|
-
label: "branchCode"
|
|
21819
|
-
}
|
|
21820
|
-
},
|
|
21821
|
-
[CountryCodes.Indonesia]: {
|
|
21822
|
-
branchCode: {
|
|
21823
|
-
label: "clearingCode"
|
|
21824
22387
|
}
|
|
21825
22388
|
},
|
|
22389
|
+
[CountryCodes.Indonesia]: {},
|
|
21826
22390
|
[CountryCodes.NewZealand]: {
|
|
21827
22391
|
bankCode: {
|
|
21828
22392
|
label: "bankCode"
|
|
21829
|
-
},
|
|
21830
|
-
branchCode: {
|
|
21831
|
-
label: "branchCode"
|
|
21832
22393
|
}
|
|
21833
22394
|
},
|
|
21834
22395
|
[CountryCodes.Singapore]: {
|
|
21835
22396
|
bankCode: {
|
|
21836
22397
|
label: "bankCode"
|
|
21837
22398
|
},
|
|
21838
|
-
branchCode: {
|
|
21839
|
-
label: "branchCode"
|
|
21840
|
-
},
|
|
21841
22399
|
swiftCode: {
|
|
21842
22400
|
label: "bic"
|
|
21843
22401
|
}
|
|
21844
22402
|
},
|
|
21845
22403
|
[CountryCodes.UnitedKingdom]: {
|
|
21846
|
-
branchCode: {
|
|
21847
|
-
label: "sortCode"
|
|
21848
|
-
},
|
|
21849
22404
|
bankCity: {
|
|
21850
22405
|
label: "bankCityTown"
|
|
21851
22406
|
},
|
|
@@ -21853,11 +22408,7 @@ const countryConfig$2 = {
|
|
|
21853
22408
|
label: "listitemVoidedChequeBankLetterBankStatementOnline"
|
|
21854
22409
|
}
|
|
21855
22410
|
},
|
|
21856
|
-
[CountryCodes.UnitedStates]: {
|
|
21857
|
-
branchCode: {
|
|
21858
|
-
label: "achRoutingNumber"
|
|
21859
|
-
}
|
|
21860
|
-
}
|
|
22411
|
+
[CountryCodes.UnitedStates]: {}
|
|
21861
22412
|
};
|
|
21862
22413
|
const parseValidationRule = (validationRule) => {
|
|
21863
22414
|
const [name, start, end] = validationRule.split(":");
|
|
@@ -22112,7 +22663,7 @@ const identityNumber = {
|
|
|
22112
22663
|
idNumber: {
|
|
22113
22664
|
rule: "isDirectorIdNumberRequiredForCountry",
|
|
22114
22665
|
verify: "isVerificationAllowedForCountry",
|
|
22115
|
-
|
|
22666
|
+
obscured: true
|
|
22116
22667
|
},
|
|
22117
22668
|
idNumberExempt: {
|
|
22118
22669
|
rules: ["idNumberExemptIfApplicableCountry", "isDirectorIdNumberRequiredForCountry"]
|
|
@@ -22409,7 +22960,7 @@ function parsePayoutScenarios({
|
|
|
22409
22960
|
rule: bankVerificationAvailable ? "whenUsingManualVerification" : "REQUIRED",
|
|
22410
22961
|
validators: [requiredValidatorRule]
|
|
22411
22962
|
};
|
|
22412
|
-
fieldConfigurations[fieldName].
|
|
22963
|
+
fieldConfigurations[fieldName].obscured = obscuredPayoutFields.includes(fieldName);
|
|
22413
22964
|
}
|
|
22414
22965
|
});
|
|
22415
22966
|
if (bankVerificationAvailable) {
|
|
@@ -22468,7 +23019,7 @@ function getPropsFromConfigurations(scenarioConfiguration, forms2, remediationAc
|
|
|
22468
23019
|
const helperText = {};
|
|
22469
23020
|
const masks = {};
|
|
22470
23021
|
const validators = {};
|
|
22471
|
-
const
|
|
23022
|
+
const obscuredFields = {};
|
|
22472
23023
|
if (!scenarioConfiguration) {
|
|
22473
23024
|
return;
|
|
22474
23025
|
}
|
|
@@ -22535,8 +23086,8 @@ function getPropsFromConfigurations(scenarioConfiguration, forms2, remediationAc
|
|
|
22535
23086
|
[field]: fieldConfigurations.validators
|
|
22536
23087
|
};
|
|
22537
23088
|
}
|
|
22538
|
-
if (fieldConfigurations.
|
|
22539
|
-
|
|
23089
|
+
if (fieldConfigurations.obscured) {
|
|
23090
|
+
obscuredFields[formId] = obscuredFields[formId] ? [...obscuredFields[formId], field] : [field];
|
|
22540
23091
|
}
|
|
22541
23092
|
}
|
|
22542
23093
|
});
|
|
@@ -22549,7 +23100,7 @@ function getPropsFromConfigurations(scenarioConfiguration, forms2, remediationAc
|
|
|
22549
23100
|
verifyFields,
|
|
22550
23101
|
placeholders,
|
|
22551
23102
|
validators,
|
|
22552
|
-
|
|
23103
|
+
obscuredFields,
|
|
22553
23104
|
helperText,
|
|
22554
23105
|
masks
|
|
22555
23106
|
};
|
|
@@ -24086,15 +24637,6 @@ function useCompanySearch({
|
|
|
24086
24637
|
reset
|
|
24087
24638
|
};
|
|
24088
24639
|
}
|
|
24089
|
-
const mapKompanyOrganizationTypeToCompanyType = (organizationType) => {
|
|
24090
|
-
const organizationTypeValue = organizationType == null ? void 0 : organizationType.toLowerCase();
|
|
24091
|
-
switch (organizationTypeValue) {
|
|
24092
|
-
case "business":
|
|
24093
|
-
return CompanyTypesValue.PRIVATE_COMPANY;
|
|
24094
|
-
default:
|
|
24095
|
-
return void 0;
|
|
24096
|
-
}
|
|
24097
|
-
};
|
|
24098
24640
|
const mapCompanyDataResponseToFormSchema = (company2) => ({
|
|
24099
24641
|
companyBasics: {
|
|
24100
24642
|
country: company2.country,
|
|
@@ -24109,9 +24651,10 @@ const mapCompanyDataResponseToFormSchema = (company2) => ({
|
|
|
24109
24651
|
postalCode: company2.zipcode
|
|
24110
24652
|
}
|
|
24111
24653
|
},
|
|
24112
|
-
|
|
24113
|
-
|
|
24114
|
-
|
|
24654
|
+
// TODO: use this when CORE-6950 is completed (BE ticket)
|
|
24655
|
+
// companyStructure: {
|
|
24656
|
+
// entityType: mapOrganizationTypeToCompanyType(company.organizationType),
|
|
24657
|
+
// },
|
|
24115
24658
|
companyOtherDetails: {
|
|
24116
24659
|
registrationNumber: company2.registrationNumber
|
|
24117
24660
|
}
|
|
@@ -24574,95 +25117,37 @@ function TaxInformationField({
|
|
|
24574
25117
|
})]
|
|
24575
25118
|
});
|
|
24576
25119
|
}
|
|
24577
|
-
const
|
|
24578
|
-
|
|
24579
|
-
|
|
24580
|
-
|
|
24581
|
-
const taxIdNumber2 = (_a = taxInformation == null ? void 0 : taxInformation.find((taxId2) => country2 === taxId2.country)) == null ? void 0 : _a.number;
|
|
24582
|
-
return taxIdNumber2 ? pattern.test(taxIdNumber2) : false;
|
|
24583
|
-
}
|
|
24584
|
-
});
|
|
24585
|
-
const defaultFieldMetadata = {
|
|
24586
|
-
label: "taxId"
|
|
24587
|
-
};
|
|
24588
|
-
const defaultFieldConfig = {
|
|
24589
|
-
...defaultFieldConfig$2,
|
|
24590
|
-
[CountryCodes.Canada]: {
|
|
24591
|
-
...defaultFieldConfig$2.CA,
|
|
24592
|
-
validators: taxInformationFieldValidation(/^\d{9}$/, CountryCodes.Canada)
|
|
24593
|
-
},
|
|
24594
|
-
[CountryCodes.HongKong]: {
|
|
24595
|
-
...defaultFieldConfig$2.HK,
|
|
24596
|
-
validators: taxInformationFieldValidation(/^\d{8}$/, CountryCodes.HongKong)
|
|
24597
|
-
},
|
|
24598
|
-
[CountryCodes.Australia]: {
|
|
24599
|
-
...defaultFieldConfig$2.AU,
|
|
24600
|
-
validators: taxInformationFieldValidation(/^\d{11}$/, CountryCodes.Australia)
|
|
24601
|
-
},
|
|
24602
|
-
[CountryCodes.NewZealand]: {
|
|
24603
|
-
...defaultFieldConfig$2.NZ,
|
|
24604
|
-
validators: taxInformationFieldValidation(/^\d{8,9}$/, CountryCodes.NewZealand)
|
|
24605
|
-
},
|
|
24606
|
-
[CountryCodes.Singapore]: {
|
|
24607
|
-
...defaultFieldConfig$2.SG,
|
|
24608
|
-
validators: taxInformationFieldValidation(/^[A-Z0-9]{9,10}$/, CountryCodes.Singapore)
|
|
24609
|
-
},
|
|
24610
|
-
[CountryCodes.UnitedStates]: ({
|
|
25120
|
+
const defaultFieldMetadata = defaultFieldMetadata$7;
|
|
25121
|
+
const defaultFieldConfig = entriesOf(defaultFieldConfig$7).reduce((fieldConfig, [country2, countryEntry]) => ({
|
|
25122
|
+
...fieldConfig,
|
|
25123
|
+
[country2]: ({
|
|
24611
25124
|
taxIdNumberType
|
|
24612
25125
|
}) => {
|
|
24613
|
-
|
|
24614
|
-
|
|
24615
|
-
|
|
24616
|
-
|
|
24617
|
-
|
|
24618
|
-
|
|
24619
|
-
|
|
24620
|
-
|
|
24621
|
-
|
|
24622
|
-
|
|
24623
|
-
|
|
24624
|
-
|
|
24625
|
-
|
|
24626
|
-
|
|
24627
|
-
|
|
24628
|
-
|
|
24629
|
-
|
|
24630
|
-
|
|
24631
|
-
|
|
24632
|
-
|
|
24633
|
-
|
|
24634
|
-
|
|
24635
|
-
|
|
24636
|
-
mask: makeMask(...numericInputs(9))
|
|
24637
|
-
},
|
|
24638
|
-
guidanceText: {
|
|
24639
|
-
key: "validationPleaseEnterAValidTaxIdNumberWithFormat",
|
|
24640
|
-
values: {
|
|
24641
|
-
format: "XXXXXXXXX"
|
|
24642
|
-
}
|
|
24643
|
-
}
|
|
24644
|
-
};
|
|
24645
|
-
}
|
|
24646
|
-
},
|
|
24647
|
-
/**
|
|
24648
|
-
* NOT YET SUPPORTED
|
|
24649
|
-
* These are brought over from the old pattern files. We have no idea if they are accurate or not.
|
|
24650
|
-
* See https://en.wikipedia.org/wiki/VAT_identification_number
|
|
24651
|
-
*/
|
|
24652
|
-
[CountryCodes.India]: {
|
|
24653
|
-
validators: taxInformationFieldValidation(/^[A-Z0-9]{15}$/, CountryCodes.India)
|
|
24654
|
-
},
|
|
24655
|
-
[CountryCodes.Japan]: {
|
|
24656
|
-
validators: taxInformationFieldValidation(/^\d{13}$/, CountryCodes.Japan)
|
|
24657
|
-
},
|
|
24658
|
-
[CountryCodes.Mexico]: {
|
|
24659
|
-
validators: taxInformationFieldValidation(/^\D{3}\d{6}\w{3}$/, CountryCodes.Mexico)
|
|
24660
|
-
// Examples: P&G851223B24, LFM200817DGA
|
|
24661
|
-
},
|
|
24662
|
-
[CountryCodes.Philippines]: {
|
|
24663
|
-
validators: taxInformationFieldValidation(/^\d{12}$/, CountryCodes.Philippines)
|
|
25126
|
+
const fieldMetadata = resolveFieldMetadata(countryEntry, {
|
|
25127
|
+
taxIdNumberType
|
|
25128
|
+
}, defaultFieldMetadata$7);
|
|
25129
|
+
const taxIdValidators = fieldMetadata.validators ? Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators] : [];
|
|
25130
|
+
const mappedValidators = taxIdValidators.map((validator) => ({
|
|
25131
|
+
...validator,
|
|
25132
|
+
validate: (taxInformation) => {
|
|
25133
|
+
var _a;
|
|
25134
|
+
const taxIdNumber2 = (_a = taxInformation == null ? void 0 : taxInformation.find((taxId2) => country2 === taxId2.country)) == null ? void 0 : _a.number;
|
|
25135
|
+
return taxIdNumber2 ? validator.validate(taxIdNumber2) : false;
|
|
25136
|
+
},
|
|
25137
|
+
errorMessage: (taxInformation) => {
|
|
25138
|
+
var _a;
|
|
25139
|
+
const taxIdNumber2 = (_a = taxInformation == null ? void 0 : taxInformation.find((taxId2) => country2 === taxId2.country)) == null ? void 0 : _a.number;
|
|
25140
|
+
if (!taxIdNumber2)
|
|
25141
|
+
return void 0;
|
|
25142
|
+
return typeof validator.errorMessage === "function" ? validator.errorMessage(taxIdNumber2) : validator.errorMessage;
|
|
25143
|
+
}
|
|
25144
|
+
}));
|
|
25145
|
+
return {
|
|
25146
|
+
...fieldMetadata,
|
|
25147
|
+
validators: mappedValidators
|
|
25148
|
+
};
|
|
24664
25149
|
}
|
|
24665
|
-
};
|
|
25150
|
+
}), {});
|
|
24666
25151
|
const COMPANY_BASICS_FORM_ID = "companyBasics";
|
|
24667
25152
|
const companyBasicsFields = [...LEGAL_COMPANY_NAME_FIELD, ...COUNTRY_FIELD, ...STATE_FIELD, ...TAX_INFORMATION_FIELD];
|
|
24668
25153
|
function CompanyBasics({
|
|
@@ -24677,7 +25162,7 @@ function CompanyBasics({
|
|
|
24677
25162
|
formVerificationErrors,
|
|
24678
25163
|
fieldValidationErrors,
|
|
24679
25164
|
requiredFields,
|
|
24680
|
-
|
|
25165
|
+
obscuredFields,
|
|
24681
25166
|
optionalFields,
|
|
24682
25167
|
readOnlyFields,
|
|
24683
25168
|
handleCompanyIndexSearch,
|
|
@@ -24687,7 +25172,7 @@ function CompanyBasics({
|
|
|
24687
25172
|
handleVerifyTin,
|
|
24688
25173
|
country: country2,
|
|
24689
25174
|
isTopLevelEntity,
|
|
24690
|
-
|
|
25175
|
+
kompanyVerifiedData,
|
|
24691
25176
|
setKompanyAddress,
|
|
24692
25177
|
setKompanyVerifiedData
|
|
24693
25178
|
}) {
|
|
@@ -24711,9 +25196,9 @@ function CompanyBasics({
|
|
|
24711
25196
|
requiredFields,
|
|
24712
25197
|
readOnlyFields,
|
|
24713
25198
|
optionalFields,
|
|
24714
|
-
|
|
25199
|
+
obscuredFields,
|
|
24715
25200
|
shouldValidate
|
|
24716
|
-
}), [helperText, labels2,
|
|
25201
|
+
}), [helperText, labels2, obscuredFields, optionalFields, placeholders, readOnly, readOnlyFields, requiredFields, shouldValidate]);
|
|
24717
25202
|
const mergedFieldProps = useMemo$1(() => {
|
|
24718
25203
|
var _a2;
|
|
24719
25204
|
return (_a2 = initialFormUtilsProps.requiredFields) == null ? void 0 : _a2.reduce((acc, field) => {
|
|
@@ -24765,7 +25250,7 @@ function CompanyBasics({
|
|
|
24765
25250
|
defaultData: data,
|
|
24766
25251
|
rules: mergedFieldProps == null ? void 0 : mergedFieldProps.validators,
|
|
24767
25252
|
optionalFields: mergedFieldProps == null ? void 0 : mergedFieldProps.optionalFields,
|
|
24768
|
-
|
|
25253
|
+
obscuredFields: mergedFieldProps == null ? void 0 : mergedFieldProps.obscuredFields,
|
|
24769
25254
|
fieldProblems: fieldValidationErrors,
|
|
24770
25255
|
shouldValidate
|
|
24771
25256
|
});
|
|
@@ -24773,7 +25258,7 @@ function CompanyBasics({
|
|
|
24773
25258
|
const formUtils = formUtilities(mergedFieldProps ?? initialFormUtilsProps, i18n);
|
|
24774
25259
|
const hasCompanySearchProvider = formData.country && COUNTRIES_WITH_IN_APP_SEARCH_COMPANY_VERIFICATION.includes(formData.country);
|
|
24775
25260
|
const currentCountryTaxIdNumber = (_b = (_a = formData.taxInformation) == null ? void 0 : _a.find((taxInfo) => taxInfo.country === formData.country)) == null ? void 0 : _b.number;
|
|
24776
|
-
const disabled = (field) => formUtils.isReadOnly(field) || Boolean(
|
|
25261
|
+
const disabled = (field) => formUtils.isReadOnly(field) || Boolean(kompanyVerifiedData) || loading2;
|
|
24777
25262
|
useEffect$1(() => {
|
|
24778
25263
|
updateStateSlice({
|
|
24779
25264
|
schema: formSchema,
|
|
@@ -24865,7 +25350,7 @@ function CompanyBasics({
|
|
|
24865
25350
|
})]
|
|
24866
25351
|
});
|
|
24867
25352
|
}
|
|
24868
|
-
const CompanyBasicsComponent = memo(CompanyBasics, (prevProps, nextProps) => objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.labels, nextProps.labels) && objectsDeepEqual(prevProps.placeholders, nextProps.placeholders) && objectsDeepEqual(prevProps.helperText, nextProps.helperText) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.heading === nextProps.heading && prevProps.description === nextProps.description && prevProps.readOnly === nextProps.readOnly && prevProps.requiredFields === nextProps.requiredFields && prevProps.
|
|
25353
|
+
const CompanyBasicsComponent = memo(CompanyBasics, (prevProps, nextProps) => objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.labels, nextProps.labels) && objectsDeepEqual(prevProps.placeholders, nextProps.placeholders) && objectsDeepEqual(prevProps.helperText, nextProps.helperText) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.heading === nextProps.heading && prevProps.description === nextProps.description && prevProps.readOnly === nextProps.readOnly && prevProps.requiredFields === nextProps.requiredFields && prevProps.obscuredFields === nextProps.obscuredFields && prevProps.optionalFields === nextProps.optionalFields && prevProps.readOnlyFields === nextProps.readOnlyFields && prevProps.shouldValidate === nextProps.shouldValidate && objectsDeepEqual(prevProps.kompanyVerifiedData, nextProps.kompanyVerifiedData));
|
|
24869
25354
|
const CompanyOtherDetailsComponent$1 = "";
|
|
24870
25355
|
const BUSINESS_REGISTRATION_NUMBER_FIELD = ["registrationNumber", "exemptedFromRegistrationNumber"];
|
|
24871
25356
|
function BusinessRegistrationNumberField({
|
|
@@ -25180,7 +25665,7 @@ function CompanyOtherDetails({
|
|
|
25180
25665
|
formVerificationErrors,
|
|
25181
25666
|
fieldValidationErrors,
|
|
25182
25667
|
requiredFields,
|
|
25183
|
-
|
|
25668
|
+
obscuredFields,
|
|
25184
25669
|
optionalFields,
|
|
25185
25670
|
readOnlyFields,
|
|
25186
25671
|
country: country2,
|
|
@@ -25213,9 +25698,9 @@ function CompanyOtherDetails({
|
|
|
25213
25698
|
requiredFields,
|
|
25214
25699
|
readOnlyFields,
|
|
25215
25700
|
optionalFields,
|
|
25216
|
-
|
|
25701
|
+
obscuredFields,
|
|
25217
25702
|
shouldValidate
|
|
25218
|
-
}), [helperText, labels2,
|
|
25703
|
+
}), [helperText, labels2, obscuredFields, optionalFields, placeholders, readOnly, readOnlyFields, requiredFields, shouldValidate]);
|
|
25219
25704
|
const mergedFieldProps = useMemo$1(() => {
|
|
25220
25705
|
var _a2;
|
|
25221
25706
|
return (_a2 = initialFormUtilsProps.requiredFields) == null ? void 0 : _a2.reduce((acc, field) => {
|
|
@@ -25253,18 +25738,18 @@ function CompanyOtherDetails({
|
|
|
25253
25738
|
}
|
|
25254
25739
|
};
|
|
25255
25740
|
case "registrationNumber":
|
|
25256
|
-
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$
|
|
25741
|
+
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$8[country2], {
|
|
25257
25742
|
companyType: companyType2,
|
|
25258
25743
|
registrationNumberType
|
|
25259
|
-
}, defaultFieldMetadata$
|
|
25744
|
+
}, defaultFieldMetadata$8), acc);
|
|
25260
25745
|
case "taxInformation":
|
|
25261
25746
|
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig[country2], {
|
|
25262
25747
|
taxIdNumberType: taxIdentificationNumberType
|
|
25263
25748
|
}, defaultFieldMetadata), acc);
|
|
25264
25749
|
case "vatNumber":
|
|
25265
|
-
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$
|
|
25750
|
+
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$6[country2], {
|
|
25266
25751
|
vatNumberType: taxIdentificationNumberType
|
|
25267
|
-
}, defaultFieldMetadata$
|
|
25752
|
+
}, defaultFieldMetadata$6), acc);
|
|
25268
25753
|
default:
|
|
25269
25754
|
return acc;
|
|
25270
25755
|
}
|
|
@@ -25283,7 +25768,7 @@ function CompanyOtherDetails({
|
|
|
25283
25768
|
defaultData: data,
|
|
25284
25769
|
rules: mergedFieldProps == null ? void 0 : mergedFieldProps.validators,
|
|
25285
25770
|
optionalFields: mergedFieldProps == null ? void 0 : mergedFieldProps.optionalFields,
|
|
25286
|
-
|
|
25771
|
+
obscuredFields: mergedFieldProps == null ? void 0 : mergedFieldProps.obscuredFields,
|
|
25287
25772
|
fieldProblems: fieldValidationErrors,
|
|
25288
25773
|
shouldValidate
|
|
25289
25774
|
});
|
|
@@ -25432,7 +25917,7 @@ function CompanyOtherDetails({
|
|
|
25432
25917
|
})]
|
|
25433
25918
|
});
|
|
25434
25919
|
}
|
|
25435
|
-
const CompanyOtherDetailsComponent = memo(CompanyOtherDetails, (prevProps, nextProps) => objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.labels, nextProps.labels) && objectsDeepEqual(prevProps.placeholders, nextProps.placeholders) && objectsDeepEqual(prevProps.helperText, nextProps.helperText) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.heading === nextProps.heading && prevProps.description === nextProps.description && prevProps.requiredFields === nextProps.requiredFields && prevProps.
|
|
25920
|
+
const CompanyOtherDetailsComponent = memo(CompanyOtherDetails, (prevProps, nextProps) => objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.labels, nextProps.labels) && objectsDeepEqual(prevProps.placeholders, nextProps.placeholders) && objectsDeepEqual(prevProps.helperText, nextProps.helperText) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.heading === nextProps.heading && prevProps.description === nextProps.description && prevProps.requiredFields === nextProps.requiredFields && prevProps.obscuredFields === nextProps.obscuredFields && prevProps.optionalFields === nextProps.optionalFields && prevProps.readOnlyFields === nextProps.readOnlyFields && prevProps.shouldValidate === nextProps.shouldValidate && prevProps.readOnly === nextProps.readOnly && prevProps.country === nextProps.country && prevProps.legalCompanyName === nextProps.legalCompanyName && prevProps.companyType === nextProps.companyType && prevProps.kompanyVerifiedData === nextProps.kompanyVerifiedData);
|
|
25436
25921
|
const CompanyStructureComponent$1 = "";
|
|
25437
25922
|
const CompanyStructureValidation = {
|
|
25438
25923
|
entityType: {
|
|
@@ -25944,7 +26429,7 @@ function CompanySearchComponent(props) {
|
|
|
25944
26429
|
handleGetCompanyDataset,
|
|
25945
26430
|
handleRefreshCompanyDataset,
|
|
25946
26431
|
handleVerifyTin,
|
|
25947
|
-
|
|
26432
|
+
kompanyVerifiedData,
|
|
25948
26433
|
setKompanyAddress,
|
|
25949
26434
|
setKompanyVerifiedData
|
|
25950
26435
|
})
|
|
@@ -27095,7 +27580,7 @@ const Remove = ({
|
|
|
27095
27580
|
})
|
|
27096
27581
|
}) : jsx(Button, {
|
|
27097
27582
|
type: "button",
|
|
27098
|
-
icon: !hasLabel ? "bin" :
|
|
27583
|
+
icon: !hasLabel ? "bin" : void 0,
|
|
27099
27584
|
ghost: !hasLabel,
|
|
27100
27585
|
secondary: hasLabel,
|
|
27101
27586
|
negative: hasLabel,
|
|
@@ -27941,13 +28426,13 @@ const PayoutAccountTaskListItem = ({
|
|
|
27941
28426
|
const [isDeletingTransferInstrument, setIsDeletingTransferInstrument] = useState(false);
|
|
27942
28427
|
const isInstantVerificationAccount = isInstantVerifiedAccount(account);
|
|
27943
28428
|
const [isRemoveDisabled, setIsRemoveDisabled] = useState(false);
|
|
27944
|
-
const
|
|
28429
|
+
const obscuredAccountNumber = getObscuredAccountNumber(account);
|
|
27945
28430
|
const status = getTaskStatus(EntityType.BANK_ACCOUNT, capabilityProblems, legalEntityResponse, [account.id], isInstantVerificationAccount);
|
|
27946
28431
|
return jsx(TaskListItem, {
|
|
27947
28432
|
disabled: isInstantVerificationAccount && status === TaskStatus.PROCESSING,
|
|
27948
28433
|
onNavigateToTask: isInstantVerificationAccount ? void 0 : onNavigateToTask,
|
|
27949
28434
|
icon: "payout",
|
|
27950
|
-
title:
|
|
28435
|
+
title: obscuredAccountNumber,
|
|
27951
28436
|
tagline: isExperimentEnabled("EnableNewEntryFlow") ? void 0 : i18n.get("payoutDetails"),
|
|
27952
28437
|
status,
|
|
27953
28438
|
problems: (_a = capabilityProblems == null ? void 0 : capabilityProblems.BankAccount) == null ? void 0 : _a[account.id],
|
|
@@ -28183,7 +28668,7 @@ function TaskListComponent({
|
|
|
28183
28668
|
title: i18n.get("pleaseEnsureTheFollowing"),
|
|
28184
28669
|
children: jsx(TaskListItem, {
|
|
28185
28670
|
onNavigateToTask: handleOnNavigateToTaskReview,
|
|
28186
|
-
icon: "
|
|
28671
|
+
icon: "review",
|
|
28187
28672
|
title: i18n.get("submitReviewOfYourData"),
|
|
28188
28673
|
status: TaskStatus.SUBMIT,
|
|
28189
28674
|
problems: (_m = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _m[legalEntityResponse.id],
|
|
@@ -28517,16 +29002,16 @@ const TrustMembersOverview = ({
|
|
|
28517
29002
|
})
|
|
28518
29003
|
});
|
|
28519
29004
|
};
|
|
28520
|
-
const
|
|
29005
|
+
const omitObscuredFieldsIfUnchanged = (obscuredFields, dataSubmitted, savedData) => {
|
|
28521
29006
|
if (!dataSubmitted) {
|
|
28522
29007
|
return;
|
|
28523
29008
|
}
|
|
28524
29009
|
const filtered = cloneObject(dataSubmitted);
|
|
28525
|
-
|
|
28526
|
-
const prevValue = getProp(savedData,
|
|
28527
|
-
const newValue = getProp(dataSubmitted,
|
|
28528
|
-
if (prevValue === newValue &&
|
|
28529
|
-
deleteProp(
|
|
29010
|
+
obscuredFields.forEach((obscuredField) => {
|
|
29011
|
+
const prevValue = getProp(savedData, obscuredField);
|
|
29012
|
+
const newValue = getProp(dataSubmitted, obscuredField);
|
|
29013
|
+
if (prevValue === newValue && isValueObscured(newValue)) {
|
|
29014
|
+
deleteProp(obscuredField, filtered);
|
|
28530
29015
|
}
|
|
28531
29016
|
});
|
|
28532
29017
|
return filtered;
|
|
@@ -28779,7 +29264,7 @@ function IndividualDropinComponent({
|
|
|
28779
29264
|
const onSubmit = async () => {
|
|
28780
29265
|
var _a2, _b2;
|
|
28781
29266
|
setLoadingStatus("loading");
|
|
28782
|
-
const dataSubmitted =
|
|
29267
|
+
const dataSubmitted = omitObscuredFieldsIfUnchanged(individualObscuredFields, data, dataFromResponse);
|
|
28783
29268
|
try {
|
|
28784
29269
|
const legalEntity = mapIndividualToLegalEntity(dataSubmitted);
|
|
28785
29270
|
const idDocumentType = (_a2 = idDocumentTypeOptions.find(({
|
|
@@ -29340,7 +29825,7 @@ function PayoutDetailsDropinComponent({
|
|
|
29340
29825
|
data: dataSubmitted,
|
|
29341
29826
|
legalEntity: legalEntityResponse
|
|
29342
29827
|
});
|
|
29343
|
-
transferInstrumentFromInput =
|
|
29828
|
+
transferInstrumentFromInput = omitObscuredFieldsIfUnchanged(["bankAccount.accountIdentification.accountNumber", "bankAccount.accountIdentification.iban"], transferInstrumentFromInput, transferInstrument);
|
|
29344
29829
|
try {
|
|
29345
29830
|
if (!transferInstrumentFromInput) {
|
|
29346
29831
|
return;
|
|
@@ -33134,31 +33619,6 @@ const AuthProvider = ({
|
|
|
33134
33619
|
children
|
|
33135
33620
|
});
|
|
33136
33621
|
};
|
|
33137
|
-
const fontFormats = ["eot", "woff", "woff2", "ttf", "otf"];
|
|
33138
|
-
const formatFullNames = {
|
|
33139
|
-
eot: "embedded-opentype",
|
|
33140
|
-
woff: "woff",
|
|
33141
|
-
woff2: "woff2",
|
|
33142
|
-
ttf: "truetype",
|
|
33143
|
-
otf: "opentype"
|
|
33144
|
-
};
|
|
33145
|
-
const getFontFaceRule = (fontFamily, fontStyle, fontWeight, fontPath, formats) => {
|
|
33146
|
-
const fontSources = formats.map((format) => `url(${fontPath}.${format}) format(${formatFullNames[format]})`);
|
|
33147
|
-
const ruleLines = [`font-family: '${fontFamily}'`, `font-style: ${fontStyle}`, `font-weight: ${fontWeight}`, `src: ${fontSources.join(",")}`];
|
|
33148
|
-
return `@font-face {${ruleLines.join(";")}}`;
|
|
33149
|
-
};
|
|
33150
|
-
const addStyleTagForFont = (fontFamily, fontStyle, fontWeight, fontPath, formats) => {
|
|
33151
|
-
const style = document.createElement("style");
|
|
33152
|
-
style.setAttribute("type", "text/css");
|
|
33153
|
-
style.innerText = getFontFaceRule(fontFamily, fontStyle, fontWeight, fontPath, formats);
|
|
33154
|
-
document.head.insertBefore(style, document.head.firstChild);
|
|
33155
|
-
};
|
|
33156
|
-
const addStyleTagForADLIconFont = (loadingContext) => {
|
|
33157
|
-
const fontPath = `${loadingContext}static/fonts`;
|
|
33158
|
-
const iconFontPath = `${fontPath}/adyen-kyc-icons`;
|
|
33159
|
-
addStyleTagForFont("adyen-kyc-icons", "normal", "normal", iconFontPath, fontFormats);
|
|
33160
|
-
};
|
|
33161
|
-
let isFlagsLoaded = false;
|
|
33162
33622
|
let isDocumentGuidanceLoaded = false;
|
|
33163
33623
|
const getIconContainer = () => {
|
|
33164
33624
|
const container = document.createElement("div");
|
|
@@ -33172,16 +33632,6 @@ const buildSpriteDOMFromResponse = (responseData) => {
|
|
|
33172
33632
|
iconContainer.innerHTML = responseData;
|
|
33173
33633
|
return iconContainer;
|
|
33174
33634
|
};
|
|
33175
|
-
const loadFlags = async (loadingContext) => {
|
|
33176
|
-
if (isFlagsLoaded)
|
|
33177
|
-
return;
|
|
33178
|
-
isFlagsLoaded = true;
|
|
33179
|
-
const responseData = await http({
|
|
33180
|
-
loadingContext,
|
|
33181
|
-
path: "static/images/country-flags.svg"
|
|
33182
|
-
}, null, "text");
|
|
33183
|
-
document.body.insertBefore(buildSpriteDOMFromResponse(responseData), document.body.firstChild);
|
|
33184
|
-
};
|
|
33185
33635
|
const loadDocumentGuidance = async (loadingContext) => {
|
|
33186
33636
|
if (isDocumentGuidanceLoaded)
|
|
33187
33637
|
return;
|
|
@@ -33317,7 +33767,6 @@ const getEmbeddedApi = ({
|
|
|
33317
33767
|
...baseRequestContext,
|
|
33318
33768
|
loadingContext
|
|
33319
33769
|
}, datasetIdentifier2, locale),
|
|
33320
|
-
loadFlags: async () => loadFlags(base),
|
|
33321
33770
|
loadDocumentGuidance: async () => loadDocumentGuidance(base),
|
|
33322
33771
|
getImageUrl: () => `${base}static/images/`,
|
|
33323
33772
|
getAllowedCountries: async () => getSupportedCountries(baseRequestContext),
|
|
@@ -33482,7 +33931,6 @@ const getKycExternalApi = ({
|
|
|
33482
33931
|
loadingContext,
|
|
33483
33932
|
clientKey
|
|
33484
33933
|
}, name, locale),
|
|
33485
|
-
loadFlags: async () => loadFlags(loadingContext),
|
|
33486
33934
|
loadDocumentGuidance: async () => loadDocumentGuidance(loadingContext),
|
|
33487
33935
|
verifyIdNumber: async (request) => verifyIdNumber({
|
|
33488
33936
|
loadingContext,
|
|
@@ -33517,15 +33965,9 @@ const CoreProvider = ({
|
|
|
33517
33965
|
enableNewEntryFlowExperiment = false,
|
|
33518
33966
|
children
|
|
33519
33967
|
}) => {
|
|
33520
|
-
const {
|
|
33521
|
-
loadingContext
|
|
33522
|
-
} = useAuthContext();
|
|
33523
33968
|
const [contextCountry, setContextCountry] = useState(initialContextCountry);
|
|
33524
33969
|
const [accountHolder2, setAccountHolder] = useAccountHolder(enableNewEntryFlowExperiment);
|
|
33525
33970
|
const [accountFormat, setAccountFormat] = useState("local");
|
|
33526
|
-
useEffect(() => {
|
|
33527
|
-
addStyleTagForADLIconFont(loadingContext);
|
|
33528
|
-
}, [loadingContext]);
|
|
33529
33971
|
const allowedCountries = useAllowedCountries();
|
|
33530
33972
|
const isCountryAllowed = (allowedCountries == null ? void 0 : allowedCountries.includes(contextCountry)) ?? true;
|
|
33531
33973
|
useEffect(() => {
|