@adyen/kyc-components 3.42.0 → 3.42.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.
Files changed (31) hide show
  1. package/dist/es/adyen-kyc-components.es.js +206 -176
  2. package/dist/es/{bg-BG-DlNb6qPG.js → bg-BG-CMCcwscy.js} +1 -1
  3. package/dist/es/{cs-CZ-Bx2-t2jA.js → cs-CZ-CWoauekB.js} +1 -1
  4. package/dist/es/{da-DK-DZKs_7ov.js → da-DK-DzEKTJHc.js} +1 -1
  5. package/dist/es/{de-DE-BWqkcynd.js → de-DE-B6M2anx6.js} +1 -1
  6. package/dist/es/{el-GR-C0KVWWIs.js → el-GR-CuqLWzR5.js} +1 -1
  7. package/dist/es/{es-ES-CJcNPC8D.js → es-ES-9XfSDirr.js} +1 -1
  8. package/dist/es/{et-EE-mSpIUjYI.js → et-EE-pmwl_J2R.js} +1 -1
  9. package/dist/es/{fi-FI-Cv3CtFxs.js → fi-FI-DgJSRyPl.js} +1 -1
  10. package/dist/es/{fr-FR-BtYKoCfy.js → fr-FR-BUhY0q6T.js} +1 -1
  11. package/dist/es/{hr-HR-Dc3ZkcUT.js → hr-HR-Cu45hWKx.js} +1 -1
  12. package/dist/es/{hu-HU-B23BksI7.js → hu-HU-igEUooEp.js} +1 -1
  13. package/dist/es/{it-IT-D2D8df6o.js → it-IT-DTdhIzgZ.js} +1 -1
  14. package/dist/es/{lt-LT-94eUKnwE.js → lt-LT-7Ir7WV1z.js} +1 -1
  15. package/dist/es/{lv-LV-LsgAwAkf.js → lv-LV-NrrHCjUD.js} +1 -1
  16. package/dist/es/{nl-NL-aj7D61S3.js → nl-NL-CfA_NFx-.js} +1 -1
  17. package/dist/es/{no-NO-FqTZe4aj.js → no-NO-CWloqbTr.js} +1 -1
  18. package/dist/es/{pl-PL-CeDF1kZg.js → pl-PL-BXvZOf8S.js} +1 -1
  19. package/dist/es/{pt-PT-DXDG2_Kw.js → pt-PT-BBmTWd3M.js} +1 -1
  20. package/dist/es/{ro-RO-CqZ3C4QL.js → ro-RO-CPB_OIDF.js} +1 -1
  21. package/dist/es/{sk-SK-DFfGxfE8.js → sk-SK-C0ojvkCe.js} +1 -1
  22. package/dist/es/{sl-SI-D-w7-teP.js → sl-SI-qgUAiBJ9.js} +1 -1
  23. package/dist/es/{sv-SE-Cx4vp_qe.js → sv-SE-CJ7RsMEw.js} +1 -1
  24. package/dist/style.css +0 -1
  25. package/dist/types/components/BankDocument/types.d.ts +4 -3
  26. package/dist/types/components/internal/Address/utils.d.ts +1 -1
  27. package/dist/types/components/internal/FormFields/Select/SelectList.d.ts +1 -1
  28. package/dist/types/components/internal/FormFields/Select/types.d.ts +8 -9
  29. package/dist/types/core/context/ExperimentContext/types.d.ts +0 -1
  30. package/dist/types/utils/entityStatusUtil.d.ts +1 -1
  31. package/package.json +2 -1
@@ -82,6 +82,7 @@ const defaultLocaleTranslations = {
82
82
  accountNumber: "Account number",
83
83
  accountNumberOrIbanVisible: "Includes your account number or IBAN",
84
84
  accountNumberVisible: "Includes your account number",
85
+ accountNumberFullOrPartialVisible: "Includes your full or partial account number",
85
86
  accountVerification: "Account Verification",
86
87
  acknowledgePciRequirements: "We hereby acknowledge that we must remain compliant with the aforementioned PCI DSS requirements at all times as long as we want to receive payments. Consequently, we must continuously reassess our environment and implement any additional PCI DSS requirements if our environment changes.",
87
88
  actionNeeded: "Action needed",
@@ -301,6 +302,7 @@ const defaultLocaleTranslations = {
301
302
  customerSupport: "Customer support",
302
303
  cyRegistrationNumber: "Αριθμός Εγγραφής",
303
304
  dateCannotBeInTheFuture: "Date cannot be in the future",
305
+ datedInTheLastXMonths: "Dated in the last %{number} months",
304
306
  dateOfIncorporation: "Date of incorporation",
305
307
  dateOfTotalAssetsCalculation: "The date on which total assets and annual turnover were calculated is often the balance sheet date.",
306
308
  dateOnDocumentNoOlderThanXMonths: "Date on the document is no older than %{numberOfMonths} months",
@@ -726,6 +728,7 @@ const defaultLocaleTranslations = {
726
728
  hasToBeOfficialDocumentFromBank: "Includes the bank logo, bank name, or bank-specific font",
727
729
  helpUsVerifyCompany: "Help us verify this company.",
728
730
  hideDetails: "Hide details",
731
+ highResolutionCheck: "High-resolution image showing the full check with clearly visible security features",
729
732
  hkid: "HKID Number",
730
733
  howDoesVerificationWithOurPartnerWorks: "How does verification with our partner %{provider} work?",
731
734
  howVerificationWithOnfidoWork: "How does verification with our partner Onfido work?",
@@ -865,7 +868,6 @@ const defaultLocaleTranslations = {
865
868
  isTrustOperationAddressSame: "Is there a different address for your trust's operations?",
866
869
  isYourNameMissingFromSigners: "Is your name missing from the list of signers?",
867
870
  issuedByTheTaxAuthority: "Issued by the tax authority or government of the country where the company is registered",
868
- issuedInTheLastXMonths: "Issued in the last %{number} months",
869
871
  issuedOrSignedByALegalRepresentative: "Issued or signed by a legal representative in the last 12 months",
870
872
  issuerState: "Issuing state",
871
873
  jobTitle: "Job title",
@@ -2923,7 +2925,6 @@ var ExperimentNames = /* @__PURE__ */ ((ExperimentNames2) => {
2923
2925
  ExperimentNames2["EnableKompanySearchByRegistrationNumber"] = "EnableKompanySearchByRegistrationNumber";
2924
2926
  ExperimentNames2["EnableNewAddressComponent"] = "EnableNewAddressComponent";
2925
2927
  ExperimentNames2["EnableNewPhoneField"] = "EnableNewPhoneField";
2926
- ExperimentNames2["EnableBankDocumentLimitedToBankStatement"] = "EnableBankDocumentLimitedToBankStatement";
2927
2928
  ExperimentNames2["AllowMoreRolesForMainRootTrustee"] = "AllowMoreRolesForMainRootTrustee";
2928
2929
  ExperimentNames2["ShowUnsupportedEntityType"] = "ShowUnsupportedEntityType";
2929
2930
  ExperimentNames2["ShowSingPassButtonForCompanies"] = "ShowSingPassButtonForCompanies";
@@ -4101,6 +4102,7 @@ const SelectListItem = ({
4101
4102
  );
4102
4103
  const VISIBLE_ITEMS = 5;
4103
4104
  function SelectList({
4105
+ selectListId,
4104
4106
  active,
4105
4107
  items,
4106
4108
  showList,
@@ -4110,7 +4112,8 @@ function SelectList({
4110
4112
  isSearch,
4111
4113
  loading,
4112
4114
  getSearchItem,
4113
- ...props
4115
+ onKeyDown,
4116
+ onSelect
4114
4117
  }) {
4115
4118
  const { i18n } = useI18nContext();
4116
4119
  const listRef = useRef(null);
@@ -4120,8 +4123,8 @@ function SelectList({
4120
4123
  useEffect(() => {
4121
4124
  var _a, _b, _c;
4122
4125
  if (listRef.current && itemHeight === 0 && showList) {
4123
- const height = ((_c = (_b = (_a = listRef.current) == null ? void 0 : _a.firstElementChild) == null ? void 0 : _b.firstElementChild) == null ? void 0 : _c.clientHeight) || 0;
4124
- setItemHeight(height);
4126
+ const height2 = ((_c = (_b = (_a = listRef.current) == null ? void 0 : _a.firstElementChild) == null ? void 0 : _b.firstElementChild) == null ? void 0 : _c.clientHeight) || 0;
4127
+ setItemHeight(height2);
4125
4128
  }
4126
4129
  }, [itemHeight, showList]);
4127
4130
  const filteredItems = items.filter((item) => {
@@ -4157,16 +4160,13 @@ function SelectList({
4157
4160
  }
4158
4161
  return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-dropdown-element adyen-kyc-dropdown-element--no-options", children: i18n.get("noOptionsFound") });
4159
4162
  }
4160
- if (isSearch && (!textFilter || textFilter.length < 3)) {
4161
- return null;
4162
- }
4163
4163
  if (visibleItems.length) {
4164
4164
  return visibleItems.map((item) => /* @__PURE__ */ jsx(
4165
4165
  SelectListItem,
4166
4166
  {
4167
4167
  item,
4168
- onKeyDown: (event) => props.onKeyDown(event, item),
4169
- onSelect: () => props.onSelect(item),
4168
+ onKeyDown: (event) => onKeyDown(event, item),
4169
+ onSelect: () => onSelect(item),
4170
4170
  selected: !!active.find((activeItem) => activeItem.id === item.id),
4171
4171
  isMulti,
4172
4172
  isSearch,
@@ -4177,10 +4177,10 @@ function SelectList({
4177
4177
  }
4178
4178
  return null;
4179
4179
  };
4180
- const calculateMaxHeight = useCallback(
4181
- () => totalItems > VISIBLE_ITEMS && itemHeight ? `${itemHeight * (VISIBLE_ITEMS - 1)}px` : "auto",
4182
- [totalItems, itemHeight]
4183
- );
4180
+ const height = useMemo(() => {
4181
+ if (loading) return "auto";
4182
+ return totalItems > VISIBLE_ITEMS && itemHeight ? `${itemHeight * (VISIBLE_ITEMS - 1)}px` : "auto";
4183
+ }, [itemHeight, totalItems, loading]);
4184
4184
  return /* @__PURE__ */ jsx(
4185
4185
  "div",
4186
4186
  {
@@ -4190,13 +4190,13 @@ function SelectList({
4190
4190
  "adyen-kyc-dropdown-list": true,
4191
4191
  "adyen-kyc-dropdown-list--active": showList
4192
4192
  }),
4193
- id: props.selectListId,
4193
+ id: selectListId,
4194
4194
  role: "listbox",
4195
4195
  onScroll: handleScroll,
4196
4196
  style: {
4197
4197
  overflowY: totalItems > VISIBLE_ITEMS ? "auto" : "hidden",
4198
4198
  position: "absolute",
4199
- height: calculateMaxHeight()
4199
+ height
4200
4200
  },
4201
4201
  ref: listRef,
4202
4202
  children: /* @__PURE__ */ jsx(
@@ -4383,7 +4383,7 @@ function debounce(func, wait, options) {
4383
4383
  }
4384
4384
  const SELECTLIST_MAX_HEIGHT = 145;
4385
4385
  const Select = ({
4386
- items = [],
4386
+ items,
4387
4387
  className = "",
4388
4388
  classNameModifiers = [],
4389
4389
  filterable = true,
@@ -4402,7 +4402,7 @@ const Select = ({
4402
4402
  resetSearch = false,
4403
4403
  loading = false,
4404
4404
  getSearchItem,
4405
- searchText,
4405
+ searchText = "",
4406
4406
  onSearchTextChange,
4407
4407
  showSearchList
4408
4408
  }) => {
@@ -4417,18 +4417,17 @@ const Select = ({
4417
4417
  const [isShowListAbove, setIsShowListAbove] = useState(false);
4418
4418
  const [scrollParent, setScrollParent] = useState(null);
4419
4419
  const debouncedOnSearch = useCallback(debounce(onSearch, 500), [onSearch]);
4420
- const closeList = () => {
4421
- if (!onSearchTextChange) setTextFilter(null);
4420
+ const closeList = useCallback(() => {
4422
4421
  setIsShowList(false);
4423
4422
  if (toggleButtonRef.current) toggleButtonRef.current.focus();
4424
- };
4423
+ }, []);
4425
4424
  const showList = () => {
4426
4425
  let sp = scrollParent;
4427
4426
  if (!sp) {
4428
4427
  sp = getScrollParent(toggleButtonRef.current);
4429
4428
  setScrollParent(sp);
4430
4429
  }
4431
- if (sp !== -1) {
4430
+ if (sp && toggleButtonRef.current) {
4432
4431
  const { bottom: scrollParentBottomPosition } = sp.getBoundingClientRect();
4433
4432
  const { bottom: toggleButtonBottomPosition } = toggleButtonRef.current.getBoundingClientRect();
4434
4433
  if (scrollParentBottomPosition - toggleButtonBottomPosition > SELECTLIST_MAX_HEIGHT) {
@@ -4439,26 +4438,30 @@ const Select = ({
4439
4438
  }
4440
4439
  setIsShowList(true);
4441
4440
  };
4442
- const hideList = () => {
4443
- setIsShowList(false);
4444
- };
4445
- const handleSelect = (selectedItem) => {
4446
- if (readonly) return;
4447
- if (isMulti) {
4448
- const isAlreadySelected = active.find((item) => item.id === selectedItem.id);
4449
- const newActiveItems = isAlreadySelected ? [...active.filter((i) => i.id !== selectedItem.id).map((i) => i.id)] : [...active.map((i) => i.id), selectedItem.id];
4450
- onChange({ target: { value: newActiveItems, name } });
4451
- } else {
4452
- closeList();
4453
- onChange({ target: { value: selectedItem.id, name } });
4454
- }
4455
- };
4441
+ const handleSelect = useCallback(
4442
+ (selectedItem) => {
4443
+ if (readonly) return;
4444
+ if (isMulti) {
4445
+ const isAlreadySelected = active.find((item) => item.id === selectedItem.id);
4446
+ const newActiveItems = isAlreadySelected ? [...active.filter((i) => i.id !== selectedItem.id).map((i) => i.id)] : [...active.map((i) => i.id), selectedItem.id];
4447
+ onChange({ target: { value: newActiveItems, name: name ?? "" } });
4448
+ } else {
4449
+ const handleOnChange = onChange;
4450
+ closeList();
4451
+ handleOnChange({
4452
+ target: { value: selectedItem.id, name: name ?? "" }
4453
+ });
4454
+ }
4455
+ if (showSearchList) setIsShowList(showSearchList);
4456
+ },
4457
+ [active, closeList, isMulti, name, onChange, readonly, showSearchList]
4458
+ );
4456
4459
  const handleButtonKeyDown = (e) => {
4457
4460
  var _a;
4458
4461
  if (e.key === KEYBOARD_KEYS.enter && filterable && isShowList && textFilter) {
4459
4462
  const value = e.currentTarget.value || e.target.value;
4460
4463
  const selectedItem = items.find((item) => item.id === value);
4461
- if (selectedItem && (isSearch && (value == null ? void 0 : value.length) > 2 || !isSearch)) {
4464
+ if (selectedItem) {
4462
4465
  handleSelect(selectedItem);
4463
4466
  showList();
4464
4467
  } else {
@@ -4481,7 +4484,8 @@ const Select = ({
4481
4484
  }
4482
4485
  };
4483
4486
  const handleClickOutside = (e) => {
4484
- if (!selectContainerRef.current.contains(e.target)) {
4487
+ var _a;
4488
+ if (!((_a = selectContainerRef.current) == null ? void 0 : _a.contains(e.target))) {
4485
4489
  setIsShowList(false);
4486
4490
  }
4487
4491
  };
@@ -4513,22 +4517,23 @@ const Select = ({
4513
4517
  break;
4514
4518
  }
4515
4519
  };
4516
- const handleTextFilter = (e) => {
4517
- const { value } = e.target;
4518
- if (isSearch && value.length > 2) {
4519
- debouncedOnSearch(value);
4520
- }
4521
- if (onSearchTextChange) {
4522
- onSearchTextChange == null ? void 0 : onSearchTextChange(value);
4520
+ const handleTextFilter = useCallback(
4521
+ (e) => {
4522
+ const { value } = e.target;
4523
+ if (isSearch) debouncedOnSearch(value);
4524
+ if (!onSearchTextChange) {
4525
+ setTextFilter(value.toLowerCase());
4526
+ return;
4527
+ }
4528
+ onSearchTextChange(value);
4523
4529
  setTextFilter(value);
4524
- } else {
4525
- setTextFilter(value.toLowerCase());
4526
- }
4527
- };
4530
+ },
4531
+ [debouncedOnSearch, isSearch, onSearchTextChange]
4532
+ );
4528
4533
  const toggleList = (e) => {
4529
4534
  e.preventDefault();
4530
4535
  if (isShowList) {
4531
- hideList();
4536
+ setIsShowList(false);
4532
4537
  } else {
4533
4538
  showList();
4534
4539
  }
@@ -4547,7 +4552,7 @@ const Select = ({
4547
4552
  }
4548
4553
  }, [isShowList]);
4549
4554
  useEffect(() => {
4550
- setIsShowList(showSearchList);
4555
+ if (showSearchList !== void 0) setIsShowList(showSearchList);
4551
4556
  }, [showSearchList]);
4552
4557
  useEffect(() => {
4553
4558
  document.addEventListener("click", handleClickOutside, true);
@@ -4575,7 +4580,7 @@ const Select = ({
4575
4580
  /* @__PURE__ */ jsx(
4576
4581
  SelectButton,
4577
4582
  {
4578
- id: uniqueId ?? null,
4583
+ id: uniqueId ?? void 0,
4579
4584
  active,
4580
4585
  filterInputRef,
4581
4586
  filterable,
@@ -4589,8 +4594,8 @@ const Select = ({
4589
4594
  showList: isShowList,
4590
4595
  toggleButtonRef,
4591
4596
  toggleList,
4592
- ariaDescribedBy: uniqueId ? `${uniqueId}${ARIA_ERROR_SUFFIX}` : null,
4593
- isMulti,
4597
+ ariaDescribedBy: uniqueId ? `${uniqueId}${ARIA_ERROR_SUFFIX}` : "",
4598
+ isMulti: Boolean(isMulti),
4594
4599
  showSelectedItemsAsTags,
4595
4600
  isSearch,
4596
4601
  hideSearchIcon: !!onSearchTextChange,
@@ -4609,7 +4614,7 @@ const Select = ({
4609
4614
  selectListRef,
4610
4615
  showList: isShowList,
4611
4616
  textFilter,
4612
- isMulti,
4617
+ isMulti: Boolean(isMulti),
4613
4618
  showAbove: isShowListAbove,
4614
4619
  isSearch,
4615
4620
  getSearchItem,
@@ -12761,7 +12766,8 @@ const SearchAddress = ({
12761
12766
  }) => {
12762
12767
  const { i18n } = useI18nContext();
12763
12768
  const [items, setItems] = useState([]);
12764
- const [loading, setLoading] = useState(false);
12769
+ const [isSearchLoading, setSearchLoading] = useState(false);
12770
+ const [isFindLoading, setFindLoading] = useState(false);
12765
12771
  const [resetSearch, setResetSearch] = useState(false);
12766
12772
  const [searchText, setSearchText] = useState(null);
12767
12773
  const [showSearchList, setShowSearchList] = useState(false);
@@ -12778,14 +12784,18 @@ const SearchAddress = ({
12778
12784
  }, [data.country]);
12779
12785
  const onFindAddress = async (selectedAddressId) => {
12780
12786
  try {
12787
+ setFindLoading(true);
12781
12788
  const response = await handleFindAddress(selectedAddressId);
12782
12789
  autocompleteAddressForm(response);
12783
12790
  } catch (e) {
12784
12791
  logger$I.error(e);
12792
+ } finally {
12793
+ setFindLoading(false);
12785
12794
  }
12786
12795
  };
12787
12796
  const onDrilldown = async (selectedAddress) => {
12788
12797
  try {
12798
+ setSearchLoading(true);
12789
12799
  const response = await handleAddressSearch(
12790
12800
  { text: selectedAddress.text, country: data.country, container: selectedAddress.id },
12791
12801
  legalEntityId
@@ -12793,13 +12803,14 @@ const SearchAddress = ({
12793
12803
  setItems((response == null ? void 0 : response.results) || []);
12794
12804
  } catch (e) {
12795
12805
  logger$I.error(e);
12806
+ } finally {
12807
+ setSearchLoading(false);
12796
12808
  }
12797
12809
  };
12798
12810
  const onChange = (e) => {
12799
12811
  const selectedAddressId = e.target.value;
12800
12812
  handleChangeFor("searchAddress", "blur")(selectedAddressId);
12801
12813
  setResetSearch(false);
12802
- setLoading(true);
12803
12814
  const selectedAddress = items.filter((i) => i.id === selectedAddressId)[0];
12804
12815
  if (selectedAddress.type === "Address") {
12805
12816
  onFindAddress(selectedAddress.id);
@@ -12810,7 +12821,6 @@ const SearchAddress = ({
12810
12821
  setSearchText(`${selectedAddress.text}`);
12811
12822
  setShowSearchList(true);
12812
12823
  }
12813
- setLoading(false);
12814
12824
  };
12815
12825
  const formatAddressItem2 = (item) => {
12816
12826
  if (item.description.includes("Addresses")) {
@@ -12834,8 +12844,8 @@ const SearchAddress = ({
12834
12844
  if (!text) {
12835
12845
  setItems([]);
12836
12846
  } else {
12837
- setLoading(true);
12838
12847
  try {
12848
+ setSearchLoading(true);
12839
12849
  const response = await handleAddressSearch({ text, country: data.country }, legalEntityId);
12840
12850
  if (response == null ? void 0 : response.results) {
12841
12851
  const modifiedItems = response.results.map(formatAddressItem2);
@@ -12845,8 +12855,9 @@ const SearchAddress = ({
12845
12855
  }
12846
12856
  } catch (e) {
12847
12857
  logger$I.error(e);
12858
+ } finally {
12859
+ setSearchLoading(false);
12848
12860
  }
12849
- setLoading(false);
12850
12861
  }
12851
12862
  };
12852
12863
  const getFormattedText2 = (highlightItems, text) => {
@@ -12927,7 +12938,7 @@ const SearchAddress = ({
12927
12938
  isSearch: true,
12928
12939
  resetSearch,
12929
12940
  onSearch: getSearchItems,
12930
- loading,
12941
+ loading: isSearchLoading || isFindLoading,
12931
12942
  getSearchItem: generateSearchListItem2,
12932
12943
  isInvalid: false,
12933
12944
  searchText,
@@ -13588,106 +13599,129 @@ function FieldContainer({
13588
13599
  const { i18n } = useI18nContext();
13589
13600
  useEffect(() => {
13590
13601
  setItems([]);
13591
- setSearchText("");
13592
13602
  setResetSearch(true);
13593
13603
  }, [data.country]);
13604
+ const [searchText, setSearchText] = useState(data.address ?? "");
13605
+ useEffect(() => setSearchText(data.address ?? ""), [data.address]);
13594
13606
  const formUtils = createFormUtils({ data }, i18n);
13595
13607
  const errorMessage = formUtils.getErrorMessage(fieldName, errors ?? {}, fieldProblems);
13596
13608
  const value = data[fieldName];
13597
13609
  const labelKey = getKeyForField(fieldName, data.country);
13610
+ const [isSearchLoading, setSearchLoading] = useState(false);
13611
+ const [isFindLoading, setFindLoading] = useState(false);
13598
13612
  const [items, setItems] = useState([]);
13599
- const [loading, setLoading] = useState(false);
13600
13613
  const [resetSearch, setResetSearch] = useState(false);
13601
13614
  const [showSearchList, setShowSearchList] = useState(false);
13602
13615
  const [selectedAddressId, setSelectedAddressId] = useState();
13603
- const [searchText, setSearchText] = useState(data.address);
13604
- useEffect(() => {
13605
- setSearchText(data.address);
13606
- }, [data.address]);
13607
- const setAddressField = ({ houseNumberOrName, street }) => {
13608
- const hasHouseNumber = !!houseNumberOrName;
13609
- if (hasHouseNumber) {
13610
- const isHouseNumberFirst = data.country ? COUNTRIES_WITH_HOUSE_NUMBER_FIRST.includes(data.country) : false;
13611
- const needsComma = data.country ? COUNTRIES_WITH_COMMA_SEPARATED.includes(data.country) : false;
13612
- const formattedAddress = isHouseNumberFirst ? `${houseNumberOrName}${needsComma ? ", " : " "}${street}` : `${street}${needsComma ? ", " : " "}${houseNumberOrName}`;
13613
- return handleChangeFor("address", "input")(formattedAddress);
13614
- }
13615
- return handleChangeFor("address", "input")(street);
13616
- };
13617
- const getSearchItems = async (text) => {
13618
- if (!text || !data.country) return setItems([]);
13619
- try {
13620
- setLoading(true);
13621
- const response = await (handleAddressSearch == null ? void 0 : handleAddressSearch({ text, country: data.country }, legalEntityId));
13622
- if (response == null ? void 0 : response.results) {
13623
- setItems(response.results.map(formatAddressItem));
13624
- } else {
13625
- setItems([]);
13616
+ const setAddressField = useCallback(
13617
+ ({ houseNumberOrName, street }) => {
13618
+ const hasHouseNumber = !!houseNumberOrName;
13619
+ if (hasHouseNumber) {
13620
+ const isHouseNumberFirst = data.country ? COUNTRIES_WITH_HOUSE_NUMBER_FIRST.includes(data.country) : false;
13621
+ const needsComma = data.country ? COUNTRIES_WITH_COMMA_SEPARATED.includes(data.country) : false;
13622
+ const formattedAddress = isHouseNumberFirst ? `${houseNumberOrName}${needsComma ? ", " : " "}${street}` : `${street}${needsComma ? ", " : " "}${houseNumberOrName}`;
13623
+ return handleChangeFor("address", "input")(formattedAddress);
13624
+ }
13625
+ return handleChangeFor("address", "input")(street);
13626
+ },
13627
+ [data.country, handleChangeFor]
13628
+ );
13629
+ const getSearchItems = useCallback(
13630
+ async (text) => {
13631
+ if (!text || !data.country) return setItems([]);
13632
+ try {
13633
+ setSearchLoading(true);
13634
+ const response = await (handleAddressSearch == null ? void 0 : handleAddressSearch(
13635
+ { text, country: data.country },
13636
+ legalEntityId
13637
+ ));
13638
+ if (response == null ? void 0 : response.results) {
13639
+ setItems(response.results.map(formatAddressItem));
13640
+ } else {
13641
+ setItems([]);
13642
+ }
13643
+ } catch (e) {
13644
+ logger$H.error(e);
13645
+ } finally {
13646
+ setSearchLoading(false);
13626
13647
  }
13627
- } catch (e) {
13628
- logger$H.error(e);
13629
- }
13630
- setLoading(false);
13631
- };
13632
- const onFindAddress = async (addressId) => {
13633
- try {
13634
- const response = await (handleFindAddress == null ? void 0 : handleFindAddress(addressId));
13635
- if (response) {
13636
- schema == null ? void 0 : schema.forEach((field) => {
13637
- switch (field) {
13638
- case "country":
13639
- handleChangeFor("country", "input")(response.country ?? " ");
13640
- break;
13641
- case "address":
13642
- setAddressField(response);
13643
- break;
13644
- case "otherAddressInformation":
13645
- handleChangeFor("otherAddressInformation", "blur")(response.street2 ?? " ");
13646
- break;
13647
- case "city":
13648
- handleChangeFor("city", "input")(response.city ?? " ");
13649
- break;
13650
- case "postalCode":
13651
- handleChangeFor("postalCode", "input")(response.postalCode ?? " ");
13652
- break;
13653
- case "stateOrProvince":
13654
- handleChangeFor("stateOrProvince", "input")(response.stateOrProvince ?? " ");
13655
- break;
13656
- default:
13657
- break;
13658
- }
13659
- });
13648
+ },
13649
+ [data.country, handleAddressSearch, legalEntityId]
13650
+ );
13651
+ const onDrilldown = useCallback(
13652
+ async (address) => {
13653
+ if (!data.country || !handleAddressSearch) return;
13654
+ try {
13655
+ setSearchLoading(true);
13656
+ const response = await handleAddressSearch(
13657
+ { text: address.text, country: data.country, container: address.id },
13658
+ legalEntityId
13659
+ );
13660
+ setItems((response == null ? void 0 : response.results) ?? []);
13661
+ } catch (e) {
13662
+ logger$H.error(e);
13663
+ } finally {
13664
+ setSearchLoading(false);
13660
13665
  }
13661
- } catch (e) {
13662
- logger$H.error(e);
13663
- }
13664
- };
13665
- const onDrilldown = async (address) => {
13666
- if (!data.country) return;
13667
- try {
13668
- const response = await (handleAddressSearch == null ? void 0 : handleAddressSearch(
13669
- { text: address.text, country: data.country, container: address.id },
13670
- legalEntityId
13671
- ));
13672
- setItems((response == null ? void 0 : response.results) || []);
13673
- } catch (e) {
13674
- logger$H.error(e);
13675
- }
13676
- };
13677
- const handleOnChange = (e) => {
13678
- const addressId = e.target.value;
13679
- setSelectedAddressId(addressId);
13680
- setLoading(true);
13681
- const selectedAddress = items.filter((i) => i.id === addressId)[0];
13682
- if (selectedAddress.type === "Address") {
13683
- onFindAddress(selectedAddress.id);
13684
- setShowSearchList(false);
13685
- } else {
13686
- onDrilldown(selectedAddress);
13687
- setShowSearchList(true);
13688
- }
13689
- setLoading(false);
13690
- };
13666
+ },
13667
+ [data.country, handleAddressSearch, legalEntityId]
13668
+ );
13669
+ const onFindAddress = useCallback(
13670
+ async (addressId) => {
13671
+ try {
13672
+ setFindLoading(true);
13673
+ const response = await (handleFindAddress == null ? void 0 : handleFindAddress(addressId));
13674
+ if (response) {
13675
+ schema == null ? void 0 : schema.forEach((field) => {
13676
+ switch (field) {
13677
+ case "country":
13678
+ handleChangeFor("country", "input")(response.country ?? " ");
13679
+ break;
13680
+ case "address":
13681
+ setAddressField(response);
13682
+ break;
13683
+ case "otherAddressInformation":
13684
+ handleChangeFor("otherAddressInformation", "blur")(response.street2 ?? " ");
13685
+ break;
13686
+ case "city":
13687
+ handleChangeFor("city", "input")(response.city ?? " ");
13688
+ break;
13689
+ case "postalCode":
13690
+ handleChangeFor("postalCode", "input")(response.postalCode ?? " ");
13691
+ break;
13692
+ case "stateOrProvince":
13693
+ handleChangeFor("stateOrProvince", "input")(response.stateOrProvince ?? " ");
13694
+ break;
13695
+ default:
13696
+ break;
13697
+ }
13698
+ });
13699
+ }
13700
+ } catch (e) {
13701
+ logger$H.error(e);
13702
+ } finally {
13703
+ setFindLoading(false);
13704
+ }
13705
+ },
13706
+ [handleChangeFor, handleFindAddress, schema, setAddressField]
13707
+ );
13708
+ const handleOnChange = useCallback(
13709
+ (e) => {
13710
+ const addressId = e.target.value;
13711
+ setSelectedAddressId(addressId);
13712
+ const selectedAddress = items.filter((i) => i.id === addressId)[0];
13713
+ if (selectedAddress.type === "Address") {
13714
+ onFindAddress(selectedAddress.id);
13715
+ setSearchText(data.address ?? "");
13716
+ setShowSearchList(false);
13717
+ } else {
13718
+ onDrilldown(selectedAddress);
13719
+ setSearchText(`${selectedAddress.text}`);
13720
+ setShowSearchList(true);
13721
+ }
13722
+ },
13723
+ [data.address, items, onDrilldown, onFindAddress]
13724
+ );
13691
13725
  const renderField = (field) => {
13692
13726
  switch (field) {
13693
13727
  case "address":
@@ -13711,7 +13745,7 @@ function FieldContainer({
13711
13745
  name: ""
13712
13746
  })),
13713
13747
  selected: selectedAddressId,
13714
- loading,
13748
+ loading: isSearchLoading || isFindLoading,
13715
13749
  onChange: handleOnChange,
13716
13750
  onSearch: getSearchItems,
13717
13751
  onSearchTextChange: (text) => handleChangeFor("address", "input")(text),
@@ -20540,11 +20574,12 @@ var BankDocumentRequirement = /* @__PURE__ */ ((BankDocumentRequirement2) => {
20540
20574
  BankDocumentRequirement2["ACCOUNT_NAME_WITH_TRUST"] = "bankAccountNameWithTrust";
20541
20575
  BankDocumentRequirement2["ACCOUNT_NUMBER_OR_IBAN"] = "accountNumberOrIbanVisible";
20542
20576
  BankDocumentRequirement2["ACCOUNT_NUMBER"] = "accountNumberVisible";
20543
- BankDocumentRequirement2["ROUTING_NUMBER"] = "routingNumberVisible";
20544
- BankDocumentRequirement2["DATE_ON_DOCUMENT"] = "issuedInTheLastXMonths";
20577
+ BankDocumentRequirement2["ACCOUNT_NUMBER_FULL_OR_PARTIAL"] = "accountNumberFullOrPartialVisible";
20578
+ BankDocumentRequirement2["DATE_ON_DOCUMENT"] = "datedInTheLastXMonths";
20545
20579
  BankDocumentRequirement2["COUNTRY_OF_BANK"] = "showsCountryOfBankAccount";
20546
20580
  BankDocumentRequirement2["OFFICIAL_DOCUMENT"] = "hasToBeOfficialDocumentFromBank";
20547
20581
  BankDocumentRequirement2["STAMP_OR_SIGNATURE"] = "hasBankStampOrBankSignature";
20582
+ BankDocumentRequirement2["HIGH_RESOLUTION_CHECK"] = "highResolutionCheck";
20548
20583
  return BankDocumentRequirement2;
20549
20584
  })(BankDocumentRequirement || {});
20550
20585
  const accountNameRequirement = {
@@ -20635,16 +20670,14 @@ const applyNamedModifiers = (country, documentModifiers) => {
20635
20670
  }
20636
20671
  };
20637
20672
  const getBankDocumentRequirements = (country, documentType, documentModifiers) => {
20638
- const baseRequirements = [
20639
- { key: BankDocumentRequirement.COUNTRY_OF_BANK },
20640
- { key: BankDocumentRequirement.OFFICIAL_DOCUMENT }
20673
+ const isBasedInUS = country === "US";
20674
+ const baseRequirements = isBasedInUS ? [{ key: BankDocumentRequirement.OFFICIAL_DOCUMENT }] : [
20675
+ { key: BankDocumentRequirement.OFFICIAL_DOCUMENT },
20676
+ { key: BankDocumentRequirement.COUNTRY_OF_BANK }
20641
20677
  ];
20642
- const accountNumberRequirement = country === "US" ? [
20643
- { key: BankDocumentRequirement.ACCOUNT_NUMBER },
20644
- { key: BankDocumentRequirement.ROUTING_NUMBER }
20645
- ] : [{ key: BankDocumentRequirement.ACCOUNT_NUMBER_OR_IBAN }];
20646
- const requireLast12Months = documentType !== BankDocumentTypes.SCREENSHOT_OF_BANK;
20647
- const requireStampOrSignature = documentType === BankDocumentTypes.DEPOSIT_SLIP || documentType === BankDocumentTypes.A_LETTER_FROM_YOUR_BANK;
20678
+ const accountNumberRequirement = isBasedInUS ? documentType === BankDocumentTypes.CHECK || documentType === BankDocumentTypes.DEPOSIT_SLIP ? [{ key: BankDocumentRequirement.ACCOUNT_NUMBER }] : [{ key: BankDocumentRequirement.ACCOUNT_NUMBER_FULL_OR_PARTIAL }] : [{ key: BankDocumentRequirement.ACCOUNT_NUMBER_OR_IBAN }];
20679
+ const requireLast12Months = isBasedInUS ? documentType === BankDocumentTypes.A_LETTER_FROM_YOUR_BANK || documentType === BankDocumentTypes.BANK_STATEMENT : documentType !== BankDocumentTypes.SCREENSHOT_OF_BANK;
20680
+ const requireStampOrSignature = !isBasedInUS && (documentType === BankDocumentTypes.DEPOSIT_SLIP || documentType === BankDocumentTypes.A_LETTER_FROM_YOUR_BANK);
20648
20681
  const requirements = [
20649
20682
  applyNamedModifiers(country, documentModifiers),
20650
20683
  ...accountNumberRequirement,
@@ -20659,6 +20692,9 @@ const getBankDocumentRequirements = (country, documentType, documentModifiers) =
20659
20692
  if (requireStampOrSignature) {
20660
20693
  requirements.push({ key: BankDocumentRequirement.STAMP_OR_SIGNATURE });
20661
20694
  }
20695
+ if (isBasedInUS && documentType === BankDocumentTypes.CHECK) {
20696
+ requirements.push({ key: BankDocumentRequirement.HIGH_RESOLUTION_CHECK });
20697
+ }
20662
20698
  return requirements;
20663
20699
  };
20664
20700
  const BankDocumentRequirements = ({
@@ -20707,14 +20743,8 @@ function BankDocument(props) {
20707
20743
  description,
20708
20744
  heading
20709
20745
  } = props;
20710
- const { isExperimentEnabled } = useExperimentsContext();
20711
20746
  const { i18n } = useI18nContext();
20712
- const bankDocumentLimitedToBankStatement = isExperimentEnabled(
20713
- "EnableBankDocumentLimitedToBankStatement"
20714
- );
20715
- const [documentType, setDocumentType] = useState(
20716
- bankDocumentLimitedToBankStatement ? BankDocumentTypes.BANK_STATEMENT : void 0
20717
- );
20747
+ const [documentType, setDocumentType] = useState();
20718
20748
  const stateRef = useRef({ setState: null });
20719
20749
  const isBankStatementOptional = (optionalFields == null ? void 0 : optionalFields.includes("bankStatementDocument")) ?? false;
20720
20750
  const formUtils = createFormUtils(props, i18n);
@@ -20801,7 +20831,7 @@ function BankDocument(props) {
20801
20831
  }
20802
20832
  ),
20803
20833
  formUtils.isVisibleField("bankStatementDocument") && /* @__PURE__ */ jsxs(Fragment, { children: [
20804
- !usingExistingUploadedDocuments && !bankDocumentLimitedToBankStatement && /* @__PURE__ */ jsx(
20834
+ !usingExistingUploadedDocuments && /* @__PURE__ */ jsx(
20805
20835
  Field,
20806
20836
  {
20807
20837
  name: "documentType",
@@ -20821,7 +20851,7 @@ function BankDocument(props) {
20821
20851
  )
20822
20852
  }
20823
20853
  ),
20824
- documentType && !bankDocumentLimitedToBankStatement ? /* @__PURE__ */ jsxs(Fragment, { children: [
20854
+ documentType ? /* @__PURE__ */ jsxs(Fragment, { children: [
20825
20855
  country ? /* @__PURE__ */ jsx(
20826
20856
  BankDocumentRequirements,
20827
20857
  {
@@ -20861,7 +20891,7 @@ function BankDocument(props) {
20861
20891
  }
20862
20892
  ) : null
20863
20893
  ] }),
20864
- (documentType || usingExistingUploadedDocuments) && !bankDocumentLimitedToBankStatement ? /* @__PURE__ */ jsx(
20894
+ documentType || usingExistingUploadedDocuments ? /* @__PURE__ */ jsx(
20865
20895
  Field,
20866
20896
  {
20867
20897
  className: "adyen-kyc-bank-document__document-description",
@@ -23564,9 +23594,9 @@ function PayoutDetails(props) {
23564
23594
  const verifyInstantly = ((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification";
23565
23595
  const showBankVerification = !isExperimentEnabled("EnablePreferInstantVerificationFlow") || isProviderWidgetInline(provider == null ? void 0 : provider.name);
23566
23596
  const bankCountry = ((_b = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _b.bankCountry) ?? country;
23567
- const bankDocumentDescription = isExperimentEnabled("EnableBankDocumentLimitedToBankStatement") ? i18n.get(
23597
+ const bankDocumentDescription = i18n.get(
23568
23598
  legalEntityResponse.type === "individual" ? "bankStatementIndividualDescription" : "bankStatementNonIndividualDescription"
23569
- ) : i18n.get("bankDocumentDescription");
23599
+ );
23570
23600
  useEffect(() => resetData(), [resetData]);
23571
23601
  useEffect(() => {
23572
23602
  if ((activeForm == null ? void 0 : activeForm.formId) === summaryStep.formId && verifyInstantly) {
@@ -43954,7 +43984,7 @@ const ConfigurationApiProvider = ({
43954
43984
  }) => {
43955
43985
  const authContext = useAuthContext();
43956
43986
  const { isEmbeddedDropin, loadingContext } = authContext;
43957
- const sdkVersion = "3.42.0";
43987
+ const sdkVersion = "3.42.1";
43958
43988
  useAnalytics({
43959
43989
  onUserEvent,
43960
43990
  legalEntityId: rootLegalEntityId,
@@ -44073,7 +44103,7 @@ const useAllowedLocales = () => {
44073
44103
  }, []);
44074
44104
  return allowedLocales;
44075
44105
  };
44076
- const localeImports = /* @__PURE__ */ Object.assign({ "./locales/bg-BG.json": () => import("./bg-BG-DlNb6qPG.js"), "./locales/cs-CZ.json": () => import("./cs-CZ-Bx2-t2jA.js"), "./locales/da-DK.json": () => import("./da-DK-DZKs_7ov.js"), "./locales/de-DE.json": () => import("./de-DE-BWqkcynd.js"), "./locales/el-GR.json": () => import("./el-GR-C0KVWWIs.js"), "./locales/en-US.instructions.json": () => import("./en-US.instructions-DLPEHGI-.js"), "./locales/en-US.json": () => Promise.resolve().then(() => enUS), "./locales/es-ES.json": () => import("./es-ES-CJcNPC8D.js"), "./locales/et-EE.json": () => import("./et-EE-mSpIUjYI.js"), "./locales/fi-FI.json": () => import("./fi-FI-Cv3CtFxs.js"), "./locales/fr-FR.json": () => import("./fr-FR-BtYKoCfy.js"), "./locales/hr-HR.json": () => import("./hr-HR-Dc3ZkcUT.js"), "./locales/hu-HU.json": () => import("./hu-HU-B23BksI7.js"), "./locales/it-IT.json": () => import("./it-IT-D2D8df6o.js"), "./locales/lt-LT.json": () => import("./lt-LT-94eUKnwE.js"), "./locales/lv-LV.json": () => import("./lv-LV-LsgAwAkf.js"), "./locales/nl-NL.json": () => import("./nl-NL-aj7D61S3.js"), "./locales/no-NO.json": () => import("./no-NO-FqTZe4aj.js"), "./locales/pl-PL.json": () => import("./pl-PL-CeDF1kZg.js"), "./locales/pt-PT.json": () => import("./pt-PT-DXDG2_Kw.js"), "./locales/ro-RO.json": () => import("./ro-RO-CqZ3C4QL.js"), "./locales/sk-SK.json": () => import("./sk-SK-DFfGxfE8.js"), "./locales/sl-SI.json": () => import("./sl-SI-D-w7-teP.js"), "./locales/sv-SE.json": () => import("./sv-SE-Cx4vp_qe.js") });
44106
+ const localeImports = /* @__PURE__ */ Object.assign({ "./locales/bg-BG.json": () => import("./bg-BG-CMCcwscy.js"), "./locales/cs-CZ.json": () => import("./cs-CZ-CWoauekB.js"), "./locales/da-DK.json": () => import("./da-DK-DzEKTJHc.js"), "./locales/de-DE.json": () => import("./de-DE-B6M2anx6.js"), "./locales/el-GR.json": () => import("./el-GR-CuqLWzR5.js"), "./locales/en-US.instructions.json": () => import("./en-US.instructions-DLPEHGI-.js"), "./locales/en-US.json": () => Promise.resolve().then(() => enUS), "./locales/es-ES.json": () => import("./es-ES-9XfSDirr.js"), "./locales/et-EE.json": () => import("./et-EE-pmwl_J2R.js"), "./locales/fi-FI.json": () => import("./fi-FI-DgJSRyPl.js"), "./locales/fr-FR.json": () => import("./fr-FR-BUhY0q6T.js"), "./locales/hr-HR.json": () => import("./hr-HR-Cu45hWKx.js"), "./locales/hu-HU.json": () => import("./hu-HU-igEUooEp.js"), "./locales/it-IT.json": () => import("./it-IT-DTdhIzgZ.js"), "./locales/lt-LT.json": () => import("./lt-LT-7Ir7WV1z.js"), "./locales/lv-LV.json": () => import("./lv-LV-NrrHCjUD.js"), "./locales/nl-NL.json": () => import("./nl-NL-CfA_NFx-.js"), "./locales/no-NO.json": () => import("./no-NO-CWloqbTr.js"), "./locales/pl-PL.json": () => import("./pl-PL-BXvZOf8S.js"), "./locales/pt-PT.json": () => import("./pt-PT-BBmTWd3M.js"), "./locales/ro-RO.json": () => import("./ro-RO-CPB_OIDF.js"), "./locales/sk-SK.json": () => import("./sk-SK-C0ojvkCe.js"), "./locales/sl-SI.json": () => import("./sl-SI-qgUAiBJ9.js"), "./locales/sv-SE.json": () => import("./sv-SE-CJ7RsMEw.js") });
44077
44107
  const loadLocale = async (locale) => {
44078
44108
  const importForLocale = localeImports[`./locales/${locale}.json`];
44079
44109
  if (!importForLocale) {
@@ -44799,7 +44829,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
44799
44829
  const { i18n } = useI18nContext();
44800
44830
  const [tab, setTab] = useState("metadata");
44801
44831
  const metadata = {
44802
- sdkVersion: "3.42.0",
44832
+ sdkVersion: "3.42.1",
44803
44833
  locale: i18n.locale,
44804
44834
  rootLegalEntityId
44805
44835
  };