@adyen/kyc-components 2.41.1 → 2.41.3

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 (69) hide show
  1. package/dist/es/adyen-kyc-components.es.js +382 -553
  2. package/dist/es/{arrow-left-CCxYxfCP.js → arrow-left-CwJQyOFz.js} +1 -1
  3. package/dist/es/{arrow-right-DF4Qe-8E.js → arrow-right-Cs_AKUOH.js} +1 -1
  4. package/dist/es/{bin-CGwewvcn.js → bin-8yaAerXc.js} +1 -1
  5. package/dist/es/{check-CeSLN4_9.js → check-_cOIMziL.js} +1 -1
  6. package/dist/es/{checkmark-DEh9MPYR.js → checkmark-CZpv8i5a.js} +1 -1
  7. package/dist/es/{checkmark-small-D_9HLctx.js → checkmark-small-C4TPve-W.js} +1 -1
  8. package/dist/es/{chevron-down-BzENwYSf.js → chevron-down-CwS2tE_6.js} +1 -1
  9. package/dist/es/{chevron-right-DczMHcvL.js → chevron-right-B8cQLres.js} +1 -1
  10. package/dist/es/{chevron-up-BLtnROd5.js → chevron-up-DccG0tVR.js} +1 -1
  11. package/dist/es/{company-2-JG34IScE.js → company-2-Cof0usfn.js} +1 -1
  12. package/dist/es/{company-D5_F_6SW.js → company-BKO80hWm.js} +1 -1
  13. package/dist/es/{contract-C6wDy9zU.js → contract-DrX5y2Qf.js} +1 -1
  14. package/dist/es/{controlling-person-C4KoSyi2.js → controlling-person-B_dn0b9H.js} +1 -1
  15. package/dist/es/{cross-BadGfrgB.js → cross-aFMJCrLf.js} +1 -1
  16. package/dist/es/{decision-maker-Cef3-OzY.js → decision-maker-28_rW1ah.js} +1 -1
  17. package/dist/es/{document-Cg4kZHpA.js → document-Bn_3PIDG.js} +1 -1
  18. package/dist/es/{download-DGC5_Bxe.js → download-DgAZobJV.js} +1 -1
  19. package/dist/es/{edit--fDhojib.js → edit-Dg19Ah77.js} +1 -1
  20. package/dist/es/{field-error-WElEN1mN.js → field-error-DkFiF_Cv.js} +1 -1
  21. package/dist/es/{info-circle-DkHN1ugA.js → info-circle-CXFfd_nO.js} +1 -1
  22. package/dist/es/{light-bulb-DEUhbRWP.js → light-bulb-CQ29JPA7.js} +1 -1
  23. package/dist/es/{location-B1Til-7Q.js → location-DmmjAv9A.js} +1 -1
  24. package/dist/es/{more-horiz-BieZKfy3.js → more-horiz-dyZQKaOn.js} +1 -1
  25. package/dist/es/{new-document-BEAJnXCG.js → new-document-CeV8zHP8.js} +1 -1
  26. package/dist/es/{owners-D1pksb86.js → owners-C1dyQqRO.js} +1 -1
  27. package/dist/es/{payout-BFiI--HY.js → payout-B-c43MDS.js} +1 -1
  28. package/dist/es/{pci-DMQLRoAn.js → pci-CVqIvwR-.js} +1 -1
  29. package/dist/es/{plus-DAnbeoyS.js → plus-BUH0nzS_.js} +1 -1
  30. package/dist/es/{remove-CEmd9YX7.js → remove-Bor5X8Xu.js} +1 -1
  31. package/dist/es/{review-CeQeKHXH.js → review-DcoDSRJT.js} +1 -1
  32. package/dist/es/{search-hf3HRVbu.js → search-SGLIdnsr.js} +1 -1
  33. package/dist/es/{signatory-BVoLPYPu.js → signatory-BMaWV_18.js} +1 -1
  34. package/dist/es/{store-D2z639xh.js → store-N4c2LHJ_.js} +1 -1
  35. package/dist/es/{trust-CpcaQaV7.js → trust-BcVDhtGL.js} +1 -1
  36. package/dist/es/{user-D6swzlYs.js → user-C8STPF6-.js} +1 -1
  37. package/dist/es/{user-business-CwS5j1qX.js → user-business-Dcvcw8gB.js} +1 -1
  38. package/dist/es/{users-3-BdjQ9rEA.js → users-3-D3QDBEk-.js} +1 -1
  39. package/dist/es/{warning-99uFf1WU.js → warning-Dxxpni4H.js} +1 -1
  40. package/dist/es/{wrong-1wvh7nZe.js → wrong-DNwa4zZR.js} +1 -1
  41. package/dist/types/components/BankVerification/BankVerification.d.ts +1 -1
  42. package/dist/types/components/BankVerification/types.d.ts +5 -5
  43. package/dist/types/components/BusinessTypeSelection/utils.d.ts +2 -1
  44. package/dist/types/components/CompanyBasics/types.d.ts +3 -3
  45. package/dist/types/components/CompanyLookup/types.d.ts +4 -4
  46. package/dist/types/components/Dropins/CompanyDropin/components/CompanyDropinComponent.d.ts +1 -1
  47. package/dist/types/components/Dropins/CompanyDropin/types.d.ts +2 -0
  48. package/dist/types/components/Individual/types.d.ts +2 -2
  49. package/dist/types/components/PayoutDetails/types.d.ts +2 -2
  50. package/dist/types/components/TaskList/types.d.ts +2 -2
  51. package/dist/types/components/internal/AccountHolder/types.d.ts +1 -1
  52. package/dist/types/components/internal/BusinessRegistrationNumberField/types.d.ts +2 -2
  53. package/dist/types/components/internal/EntityAssociation/types.d.ts +2 -2
  54. package/dist/types/components/internal/Remove/types.d.ts +3 -3
  55. package/dist/types/components/internal/TaxInformationField/types.d.ts +2 -2
  56. package/dist/types/components/internal/VatNumberField/types.d.ts +2 -2
  57. package/dist/types/core/Context/QueryContext/QueryClient.d.ts +2 -0
  58. package/dist/types/core/Context/QueryContext/QueryClientProvider.d.ts +4 -0
  59. package/dist/types/core/hooks/introduction/useHasSeenIntroduction.d.ts +1 -1
  60. package/dist/types/core/hooks/singpass/useHasSeenSingpassSelection.d.ts +1 -1
  61. package/dist/types/core/hooks/useCompanySearch/types.d.ts +2 -2
  62. package/dist/types/core/hooks/useCompanySearchTaskSubmit.d.ts +3 -3
  63. package/dist/types/core/hooks/useForm/types.d.ts +8 -8
  64. package/dist/types/core/hooks/useFormComposer.d.ts +2 -2
  65. package/dist/types/core/hooks/useLocalStorage.d.ts +2 -2
  66. package/dist/types/utils/accountHolderUtils.d.ts +1 -1
  67. package/dist/types/utils/mapping/mapping.d.ts +2 -1
  68. package/dist/types/utils/useStateFromProp.d.ts +2 -2
  69. package/package.json +8 -2
@@ -7,9 +7,10 @@ import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
7
7
  import { debounce, noop as noop$1, isEmpty as isEmpty$1, range } from "lodash";
8
8
  import isISIN from "validator/es/lib/isISIN.js";
9
9
  import OpenBankingSDK from "@adyen/openbankingsdk";
10
- import { jsxs as jsxs$1, jsx as jsx$1 } from "preact/compat/jsx-runtime";
10
+ import { jsxs as jsxs$1, jsx as jsx$1 } from "react/jsx-runtime";
11
11
  import "@adyen/adyen-document-viewer/dist/adyen-document-viewer.min.css";
12
12
  import AdyenDocumentViewer from "@adyen/adyen-document-viewer";
13
+ import { QueryClient as QueryClient$1, QueryClientProvider as QueryClientProvider$1 } from "@tanstack/react-query";
13
14
  const ConfigurationApiContext = createContext(void 0);
14
15
  const useConfigurationApi = () => {
15
16
  const configurationApi = useContext(ConfigurationApiContext);
@@ -2591,21 +2592,17 @@ const matchLocale = (locale, supportedLocales) => supportedLocales.find((supLoc)
2591
2592
  function formatLocale(localeParam) {
2592
2593
  const locale = localeParam.replace("_", "-");
2593
2594
  const format = /([a-z]{2})(-)([A-Z]{2})/;
2594
- if (format.test(locale))
2595
- return locale;
2595
+ if (format.test(locale)) return locale;
2596
2596
  const [languageCode, countryCode] = locale.split("-");
2597
- if (!languageCode || !countryCode)
2598
- return null;
2597
+ if (!languageCode || !countryCode) return null;
2599
2598
  const fullLocale = [languageCode.toLowerCase(), countryCode.toUpperCase()].join("-");
2600
2599
  return fullLocale.length === 5 ? fullLocale : null;
2601
2600
  }
2602
2601
  function parseLocale(locale, supportedLocales = []) {
2603
- if (!locale || locale.length < 1 || locale.length > 5)
2604
- return FALLBACK_LOCALE;
2602
+ if (!locale || locale.length < 1 || locale.length > 5) return FALLBACK_LOCALE;
2605
2603
  const formattedLocale = formatLocale(locale);
2606
2604
  const hasMatch = Boolean(formattedLocale && supportedLocales.includes(formattedLocale));
2607
- if (hasMatch)
2608
- return formattedLocale;
2605
+ if (hasMatch) return formattedLocale;
2609
2606
  return matchLocale(formattedLocale || locale, supportedLocales);
2610
2607
  }
2611
2608
  const formatCustomTranslations = (supportedLocales, customTranslations = {}) => Object.keys(customTranslations).reduce((acc, cur) => {
@@ -2965,7 +2962,7 @@ const mergeFieldMetadataIntoProps = (fieldName, metadata, otherProps) => {
2965
2962
  const MAX_LENGTH = 30;
2966
2963
  const getMaxLengthByFieldAndCountry = (formattingRules, field, country2, ignoreIfFormatterExists) => {
2967
2964
  var _a, _b, _c, _d;
2968
- if (ignoreIfFormatterExists && ((_b = (_a = formattingRules[country2]) == null ? void 0 : _a[field]) == null ? void 0 : _b.formatter)) {
2965
+ if ((_b = (_a = formattingRules[country2]) == null ? void 0 : _a[field]) == null ? void 0 : _b.formatter) {
2969
2966
  return null;
2970
2967
  }
2971
2968
  const maxLength = (_d = (_c = formattingRules[country2]) == null ? void 0 : _c[field]) == null ? void 0 : _d.maxlength;
@@ -2985,8 +2982,7 @@ const createLogger = (namespace) => {
2985
2982
  const methods = {};
2986
2983
  consoleMethodsPrefixable.forEach((method) => {
2987
2984
  methods[method] = (arg1, ...args) => {
2988
- if (!console[method] || suppressed)
2989
- return;
2985
+ if (!console[method] || suppressed) return;
2990
2986
  if (!namespace) {
2991
2987
  console[method](arg1, ...args);
2992
2988
  } else if (stringSubstitutionRegex.test(arg1)) {
@@ -2999,45 +2995,45 @@ const createLogger = (namespace) => {
2999
2995
  return methods;
3000
2996
  };
3001
2997
  const icons = {
3002
- "arrow-left": lazy(() => import("./arrow-left-CCxYxfCP.js")),
3003
- "arrow-right": lazy(() => import("./arrow-right-DF4Qe-8E.js")),
3004
- bin: lazy(() => import("./bin-CGwewvcn.js")),
3005
- check: lazy(() => import("./check-CeSLN4_9.js")),
3006
- checkmark: lazy(() => import("./checkmark-DEh9MPYR.js")),
3007
- "checkmark-small": lazy(() => import("./checkmark-small-D_9HLctx.js")),
3008
- "chevron-down": lazy(() => import("./chevron-down-BzENwYSf.js")),
3009
- "chevron-right": lazy(() => import("./chevron-right-DczMHcvL.js")),
3010
- "chevron-up": lazy(() => import("./chevron-up-BLtnROd5.js")),
3011
- company: lazy(() => import("./company-D5_F_6SW.js")),
3012
- "company-2": lazy(() => import("./company-2-JG34IScE.js")),
3013
- contract: lazy(() => import("./contract-C6wDy9zU.js")),
3014
- "controlling-person": lazy(() => import("./controlling-person-C4KoSyi2.js")),
3015
- cross: lazy(() => import("./cross-BadGfrgB.js")),
3016
- "decision-maker": lazy(() => import("./decision-maker-Cef3-OzY.js")),
3017
- document: lazy(() => import("./document-Cg4kZHpA.js")),
3018
- download: lazy(() => import("./download-DGC5_Bxe.js")),
3019
- edit: lazy(() => import("./edit--fDhojib.js")),
3020
- "field-error": lazy(() => import("./field-error-WElEN1mN.js")),
3021
- "info-circle": lazy(() => import("./info-circle-DkHN1ugA.js")),
3022
- "light-bulb": lazy(() => import("./light-bulb-DEUhbRWP.js")),
3023
- location: lazy(() => import("./location-B1Til-7Q.js")),
3024
- "more-horiz": lazy(() => import("./more-horiz-BieZKfy3.js")),
3025
- "new-document": lazy(() => import("./new-document-BEAJnXCG.js")),
3026
- owners: lazy(() => import("./owners-D1pksb86.js")),
3027
- payout: lazy(() => import("./payout-BFiI--HY.js")),
3028
- pci: lazy(() => import("./pci-DMQLRoAn.js")),
3029
- plus: lazy(() => import("./plus-DAnbeoyS.js")),
3030
- remove: lazy(() => import("./remove-CEmd9YX7.js")),
3031
- review: lazy(() => import("./review-CeQeKHXH.js")),
3032
- search: lazy(() => import("./search-hf3HRVbu.js")),
3033
- signatory: lazy(() => import("./signatory-BVoLPYPu.js")),
3034
- store: lazy(() => import("./store-D2z639xh.js")),
3035
- trust: lazy(() => import("./trust-CpcaQaV7.js")),
3036
- user: lazy(() => import("./user-D6swzlYs.js")),
3037
- "user-business": lazy(() => import("./user-business-CwS5j1qX.js")),
3038
- "users-3": lazy(() => import("./users-3-BdjQ9rEA.js")),
3039
- warning: lazy(() => import("./warning-99uFf1WU.js")),
3040
- wrong: lazy(() => import("./wrong-1wvh7nZe.js"))
2998
+ "arrow-left": lazy(() => import("./arrow-left-CwJQyOFz.js")),
2999
+ "arrow-right": lazy(() => import("./arrow-right-Cs_AKUOH.js")),
3000
+ bin: lazy(() => import("./bin-8yaAerXc.js")),
3001
+ check: lazy(() => import("./check-_cOIMziL.js")),
3002
+ checkmark: lazy(() => import("./checkmark-CZpv8i5a.js")),
3003
+ "checkmark-small": lazy(() => import("./checkmark-small-C4TPve-W.js")),
3004
+ "chevron-down": lazy(() => import("./chevron-down-CwS2tE_6.js")),
3005
+ "chevron-right": lazy(() => import("./chevron-right-B8cQLres.js")),
3006
+ "chevron-up": lazy(() => import("./chevron-up-DccG0tVR.js")),
3007
+ company: lazy(() => import("./company-BKO80hWm.js")),
3008
+ "company-2": lazy(() => import("./company-2-Cof0usfn.js")),
3009
+ contract: lazy(() => import("./contract-DrX5y2Qf.js")),
3010
+ "controlling-person": lazy(() => import("./controlling-person-B_dn0b9H.js")),
3011
+ cross: lazy(() => import("./cross-aFMJCrLf.js")),
3012
+ "decision-maker": lazy(() => import("./decision-maker-28_rW1ah.js")),
3013
+ document: lazy(() => import("./document-Bn_3PIDG.js")),
3014
+ download: lazy(() => import("./download-DgAZobJV.js")),
3015
+ edit: lazy(() => import("./edit-Dg19Ah77.js")),
3016
+ "field-error": lazy(() => import("./field-error-DkFiF_Cv.js")),
3017
+ "info-circle": lazy(() => import("./info-circle-CXFfd_nO.js")),
3018
+ "light-bulb": lazy(() => import("./light-bulb-CQ29JPA7.js")),
3019
+ location: lazy(() => import("./location-DmmjAv9A.js")),
3020
+ "more-horiz": lazy(() => import("./more-horiz-dyZQKaOn.js")),
3021
+ "new-document": lazy(() => import("./new-document-CeV8zHP8.js")),
3022
+ owners: lazy(() => import("./owners-C1dyQqRO.js")),
3023
+ payout: lazy(() => import("./payout-B-c43MDS.js")),
3024
+ pci: lazy(() => import("./pci-CVqIvwR-.js")),
3025
+ plus: lazy(() => import("./plus-BUH0nzS_.js")),
3026
+ remove: lazy(() => import("./remove-Bor5X8Xu.js")),
3027
+ review: lazy(() => import("./review-DcoDSRJT.js")),
3028
+ search: lazy(() => import("./search-SGLIdnsr.js")),
3029
+ signatory: lazy(() => import("./signatory-BMaWV_18.js")),
3030
+ store: lazy(() => import("./store-N4c2LHJ_.js")),
3031
+ trust: lazy(() => import("./trust-BcVDhtGL.js")),
3032
+ user: lazy(() => import("./user-C8STPF6-.js")),
3033
+ "user-business": lazy(() => import("./user-business-Dcvcw8gB.js")),
3034
+ "users-3": lazy(() => import("./users-3-D3QDBEk-.js")),
3035
+ warning: lazy(() => import("./warning-Dxxpni4H.js")),
3036
+ wrong: lazy(() => import("./wrong-DNwa4zZR.js"))
3041
3037
  };
3042
3038
  const logger$u = createLogger("Icon");
3043
3039
  const Icon = ({
@@ -3177,8 +3173,7 @@ const Alert = ({
3177
3173
  i18n
3178
3174
  } = useI18nContext();
3179
3175
  const [isClosed, setIsClosed] = useState(false);
3180
- if (isClosed)
3181
- return null;
3176
+ if (isClosed) return null;
3182
3177
  const closeAlert = () => setIsClosed(true);
3183
3178
  const classNames = cx("adl-alert", className, {
3184
3179
  "adl-alert--basic": type === AlertTypes.BASIC,
@@ -3290,8 +3285,7 @@ const Link = ({
3290
3285
  iconLeft = false,
3291
3286
  onClick
3292
3287
  }) => {
3293
- if (!isValidLink(href))
3294
- return null;
3288
+ if (!isValidLink(href)) return null;
3295
3289
  const target = external ? "_blank" : "_self";
3296
3290
  const rel = external ? "external noopener noreferrer" : void 0;
3297
3291
  const showIcon = icon || external;
@@ -3569,8 +3563,7 @@ const useAllowedCountries = () => {
3569
3563
  } = useConfigurationApi();
3570
3564
  const [allowedCountries, setAllowedCountries] = useState(acceptedCountries);
3571
3565
  useEffect(() => {
3572
- if (acceptedCountries !== void 0)
3573
- return;
3566
+ if (acceptedCountries !== void 0) return;
3574
3567
  getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$s.error);
3575
3568
  }, [acceptedCountries]);
3576
3569
  return allowedCountries;
@@ -3701,8 +3694,7 @@ function reducer({
3701
3694
  const validationSchema = selectedSchema || state2.schema;
3702
3695
  switch (type) {
3703
3696
  case "setData": {
3704
- if (!key)
3705
- return state2;
3697
+ if (!key) return state2;
3706
3698
  return {
3707
3699
  ...state2,
3708
3700
  data: {
@@ -3712,8 +3704,7 @@ function reducer({
3712
3704
  };
3713
3705
  }
3714
3706
  case "setValid": {
3715
- if (!key)
3716
- return state2;
3707
+ if (!key) return state2;
3717
3708
  return {
3718
3709
  ...state2,
3719
3710
  valid: {
@@ -3723,8 +3714,7 @@ function reducer({
3723
3714
  };
3724
3715
  }
3725
3716
  case "setErrors": {
3726
- if (!key)
3727
- return state2;
3717
+ if (!key) return state2;
3728
3718
  return {
3729
3719
  ...state2,
3730
3720
  errors: {
@@ -3750,8 +3740,7 @@ function reducer({
3750
3740
  }, state2);
3751
3741
  }
3752
3742
  case "setSchema": {
3753
- if (!schema)
3754
- return state2;
3743
+ if (!schema) return state2;
3755
3744
  const defaultState = init({
3756
3745
  schema,
3757
3746
  defaultData,
@@ -3786,8 +3775,7 @@ function reducer({
3786
3775
  };
3787
3776
  }
3788
3777
  case "updateField": {
3789
- if (!key || !mode)
3790
- return state2;
3778
+ if (!key || !mode) return state2;
3791
3779
  const [formattedValue, validation] = processField({
3792
3780
  key,
3793
3781
  value,
@@ -3915,11 +3903,9 @@ const useAsyncValidator = (asyncRules) => {
3915
3903
  const [asyncValidationResults, setAsyncValidationResults] = useState({});
3916
3904
  const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
3917
3905
  const triggerAsyncValidation = useCallback((field, formState, mode) => {
3918
- if (!asyncRules)
3919
- return clearAsyncValidationResults();
3906
+ if (!asyncRules) return clearAsyncValidationResults();
3920
3907
  const rule = asyncRules[field];
3921
- if (!rule || !rule.modes.includes(mode))
3922
- return clearAsyncValidationResults();
3908
+ if (!rule || !rule.modes.includes(mode)) return clearAsyncValidationResults();
3923
3909
  const value = formState.data[field];
3924
3910
  return rule.asyncValidate(formState.data[field], {
3925
3911
  state: formState
@@ -3972,8 +3958,7 @@ const useStaticValidator = (rules2) => {
3972
3958
  };
3973
3959
  };
3974
3960
  const mergeStaticAndAsyncErrorsState = (staticValidationErrors, asyncValidationErrors, schema) => {
3975
- if (!schema.length)
3976
- return staticValidationErrors;
3961
+ if (!schema.length) return staticValidationErrors;
3977
3962
  return schema.reduce((acc, field) => {
3978
3963
  var _a;
3979
3964
  return {
@@ -4027,8 +4012,7 @@ function useForm({
4027
4012
  return (_a = state2.schema) == null ? void 0 : _a.every((key) => state2.valid[key]);
4028
4013
  }, [state2.schema, state2.valid]);
4029
4014
  const getTargetValue = useCallback((key, e) => {
4030
- if (!(e == null ? void 0 : e.target))
4031
- return e;
4015
+ if (!(e == null ? void 0 : e.target)) return e;
4032
4016
  if (e.target.type === "checkbox") {
4033
4017
  return !state2.data[key];
4034
4018
  }
@@ -4124,8 +4108,7 @@ function useDataset(datasetIdentifier2, skip) {
4124
4108
  const [dataset, setDataset] = useState([]);
4125
4109
  const [loaded, setLoaded] = useState(false);
4126
4110
  useEffect(() => {
4127
- if (skip)
4128
- return;
4111
+ if (skip) return;
4129
4112
  getDataset2(datasetIdentifier2, i18n.locale).then((response) => {
4130
4113
  const result = response && response.length ? response : [];
4131
4114
  setDataset(result);
@@ -4288,15 +4271,12 @@ const Field = ({
4288
4271
  isValid: !!isValid,
4289
4272
  onBlurHandler: (e) => {
4290
4273
  setIsFocused(false);
4291
- if (onBlur)
4292
- onBlur(e);
4293
- if (onFieldBlur)
4294
- onFieldBlur(e);
4274
+ if (onBlur) onBlur(e);
4275
+ if (onFieldBlur) onFieldBlur(e);
4295
4276
  },
4296
4277
  onFocusHandler: (e) => {
4297
4278
  setIsFocused(true);
4298
- if (onFocus)
4299
- onFocus(e);
4279
+ if (onFocus) onFocus(e);
4300
4280
  },
4301
4281
  uniqueId
4302
4282
  }), helper && helperPosition === "below" && jsx("span", {
@@ -4333,13 +4313,11 @@ const Field = ({
4333
4313
  });
4334
4314
  };
4335
4315
  const getScrollParent = (node) => {
4336
- if (!node)
4337
- return null;
4316
+ if (!node) return null;
4338
4317
  const isElement = node instanceof HTMLElement;
4339
4318
  const overflowY = isElement && window.getComputedStyle(node).overflowY;
4340
4319
  const isScrollable = overflowY !== "visible" && overflowY !== "hidden";
4341
- if (isElement && isScrollable)
4342
- return node;
4320
+ if (isElement && isScrollable) return node;
4343
4321
  return getScrollParent(node.parentNode) ?? document.body;
4344
4322
  };
4345
4323
  function uuidv4() {
@@ -4389,11 +4367,10 @@ function SelectButtonElement({
4389
4367
  isSearch,
4390
4368
  ...props
4391
4369
  }) {
4392
- if (filterable || isMulti || isSearch)
4393
- return jsx("div", {
4394
- ...props,
4395
- ref: toggleButtonRef
4396
- });
4370
+ if (filterable || isMulti || isSearch) return jsx("div", {
4371
+ ...props,
4372
+ ref: toggleButtonRef
4373
+ });
4397
4374
  return jsx("button", {
4398
4375
  ...props,
4399
4376
  ref: toggleButtonRef,
@@ -4585,13 +4562,11 @@ const SelectListItem = ({
4585
4562
  "data-disabled": !!item.disabled,
4586
4563
  "data-value": item.id,
4587
4564
  onClick: () => {
4588
- if (item.disabled)
4589
- return;
4565
+ if (item.disabled) return;
4590
4566
  onSelect(!selected);
4591
4567
  },
4592
4568
  onKeyDown: (e) => {
4593
- if (item.disabled)
4594
- return;
4569
+ if (item.disabled) return;
4595
4570
  onKeyDown(e);
4596
4571
  },
4597
4572
  role: "option",
@@ -4723,8 +4698,7 @@ const Select = ({
4723
4698
  const closeList = () => {
4724
4699
  setTextFilter(null);
4725
4700
  setIsShowList(false);
4726
- if (toggleButtonRef.current)
4727
- toggleButtonRef.current.focus();
4701
+ if (toggleButtonRef.current) toggleButtonRef.current.focus();
4728
4702
  };
4729
4703
  const showList = () => {
4730
4704
  let sp = scrollParent;
@@ -4751,8 +4725,7 @@ const Select = ({
4751
4725
  setIsShowList(false);
4752
4726
  };
4753
4727
  const handleSelect = (selectedItem) => {
4754
- if (readonly)
4755
- return;
4728
+ if (readonly) return;
4756
4729
  if (isMulti) {
4757
4730
  const isAlreadySelected = active.find((item) => item.id === selectedItem.id);
4758
4731
  const newActiveItems = isAlreadySelected ? [...active.filter((i) => i.id !== selectedItem.id).map((i) => i.id)] : [...active.map((i) => i.id), selectedItem.id];
@@ -4815,8 +4788,7 @@ const Select = ({
4815
4788
  break;
4816
4789
  case KEYBOARD_KEYS.arrowDown:
4817
4790
  e.preventDefault();
4818
- if (target.nextElementSibling)
4819
- target.nextElementSibling.focus();
4791
+ if (target.nextElementSibling) target.nextElementSibling.focus();
4820
4792
  break;
4821
4793
  case KEYBOARD_KEYS.arrowUp:
4822
4794
  e.preventDefault();
@@ -5615,8 +5587,7 @@ const tryShift = (matchedTokens, remainingTokens, fromIndex, shiftDistance) => {
5615
5587
  }
5616
5588
  return ((_a = token.allow) == null ? void 0 : _a.test(token.potentialValue)) ?? true;
5617
5589
  });
5618
- if (!allValid)
5619
- return "notPossible";
5590
+ if (!allValid) return "notPossible";
5620
5591
  let matchedUpTo = 0;
5621
5592
  for (let i = 0; i < normalizedTokens.length; i += 1) {
5622
5593
  const token = normalizedInputTokens.find((t) => t.originalIndex === i) ?? normalizedTokens[i];
@@ -5651,8 +5622,7 @@ const getAvailableInputTokens = (tokens) => {
5651
5622
  ...token,
5652
5623
  offset: tokens.indexOf(token)
5653
5624
  });
5654
- if (token.type !== "input" || !token.optional)
5655
- break;
5625
+ if (token.type !== "input" || !token.optional) break;
5656
5626
  }
5657
5627
  return availableTokens;
5658
5628
  };
@@ -5661,13 +5631,10 @@ const getEagerSuffix = (tokens) => {
5661
5631
  let suffix = "";
5662
5632
  for (const token of tokens) {
5663
5633
  if (token.type === "input") {
5664
- if (token.optional)
5665
- continue;
5666
- else
5667
- break;
5634
+ if (token.optional) continue;
5635
+ else break;
5668
5636
  }
5669
- if (!token.displayEagerly)
5670
- break;
5637
+ if (!token.displayEagerly) break;
5671
5638
  suffix += token.char;
5672
5639
  }
5673
5640
  return suffix;
@@ -5695,12 +5662,11 @@ const matchAgainstMask = (pureValue, mask, acceptObscuredValue = false) => {
5695
5662
  while (true) {
5696
5663
  const char = charsToProcess[0];
5697
5664
  const token = tokensToProcess[0];
5698
- if (!char && !tokensToProcess.some((t) => t.type === "input" && !t.optional))
5699
- return {
5700
- outcome: "correct",
5701
- displayValue: displayValue() + getEagerSuffix(tokensToProcess),
5702
- potentialForMoreOptionalInput: getPotentialForMoreOptionalInput(tokensToProcess)
5703
- };
5665
+ if (!char && !tokensToProcess.some((t) => t.type === "input" && !t.optional)) return {
5666
+ outcome: "correct",
5667
+ displayValue: displayValue() + getEagerSuffix(tokensToProcess),
5668
+ potentialForMoreOptionalInput: getPotentialForMoreOptionalInput(tokensToProcess)
5669
+ };
5704
5670
  if (!char) {
5705
5671
  const output = shiftRight(mask.possibleShifts, matchedTokens, tokensToProcess);
5706
5672
  matchedTokens = output.matchedTokens;
@@ -5710,24 +5676,22 @@ const matchAgainstMask = (pureValue, mask, acceptObscuredValue = false) => {
5710
5676
  displayValue: displayValue() + getEagerSuffix(tokensToProcess)
5711
5677
  };
5712
5678
  }
5713
- if (!token)
5714
- return {
5715
- outcome: "mismatch",
5716
- badChar: char,
5717
- mismatchAtChar: charIndex,
5718
- mismatchedToken: "inputTooLong",
5719
- partialDisplayValue: displayValue()
5720
- };
5679
+ if (!token) return {
5680
+ outcome: "mismatch",
5681
+ badChar: char,
5682
+ mismatchAtChar: charIndex,
5683
+ mismatchedToken: "inputTooLong",
5684
+ partialDisplayValue: displayValue()
5685
+ };
5721
5686
  if (token.type === "nonInput") {
5722
5687
  if (token.includeInValue) {
5723
- if (char !== token.char)
5724
- return {
5725
- outcome: "mismatch",
5726
- badChar: char,
5727
- mismatchAtChar: charIndex,
5728
- mismatchedToken: token,
5729
- partialDisplayValue: displayValue()
5730
- };
5688
+ if (char !== token.char) return {
5689
+ outcome: "mismatch",
5690
+ badChar: char,
5691
+ mismatchAtChar: charIndex,
5692
+ mismatchedToken: token,
5693
+ partialDisplayValue: displayValue()
5694
+ };
5731
5695
  shiftChars(1);
5732
5696
  }
5733
5697
  matchedTokens.push(token);
@@ -5736,14 +5700,13 @@ const matchAgainstMask = (pureValue, mask, acceptObscuredValue = false) => {
5736
5700
  if (token.type === "input") {
5737
5701
  const availableTokens = getAvailableInputTokens(tokensToProcess);
5738
5702
  const matchingToken = findMatchingToken(availableTokens, char);
5739
- if (!matchingToken)
5740
- return {
5741
- outcome: "mismatch",
5742
- badChar: char,
5743
- mismatchAtChar: charIndex,
5744
- mismatchedToken: token,
5745
- partialDisplayValue: displayValue()
5746
- };
5703
+ if (!matchingToken) return {
5704
+ outcome: "mismatch",
5705
+ badChar: char,
5706
+ mismatchAtChar: charIndex,
5707
+ mismatchedToken: token,
5708
+ partialDisplayValue: displayValue()
5709
+ };
5747
5710
  matchedTokens.push({
5748
5711
  ...matchingToken,
5749
5712
  char
@@ -5754,30 +5717,26 @@ const matchAgainstMask = (pureValue, mask, acceptObscuredValue = false) => {
5754
5717
  }
5755
5718
  };
5756
5719
  const deriveInputState = (isValid, isFocused, hasBlurred, isDisabled, errorMessage, shouldValidate, potentiallyMoreOptionalCharacters, formatGuidance, i18n) => {
5757
- if (isDisabled)
5758
- return {
5759
- isError: false
5760
- };
5761
- if (isValid && (!potentiallyMoreOptionalCharacters || !isFocused))
5762
- return {
5763
- isError: false,
5764
- text: jsxs(Fragment, {
5765
- children: [jsx(Icon, {
5766
- name: "checkmark-small",
5767
- className: "adyen-kyc-helper-text__valid-format-check"
5768
- }), i18n.get("formatIsCorrect")]
5769
- })
5770
- };
5771
- if (isFocused && formatGuidance)
5772
- return {
5773
- isError: false,
5774
- text: formatGuidance
5775
- };
5776
- if (!isValid && (shouldValidate || hasBlurred))
5777
- return {
5778
- isError: true,
5779
- text: typeof errorMessage === "string" && errorMessage ? errorMessage : formatGuidance
5780
- };
5720
+ if (isDisabled) return {
5721
+ isError: false
5722
+ };
5723
+ if (isValid && (!potentiallyMoreOptionalCharacters || !isFocused)) return {
5724
+ isError: false,
5725
+ text: jsxs(Fragment, {
5726
+ children: [jsx(Icon, {
5727
+ name: "checkmark-small",
5728
+ className: "adyen-kyc-helper-text__valid-format-check"
5729
+ }), i18n.get("formatIsCorrect")]
5730
+ })
5731
+ };
5732
+ if (isFocused && formatGuidance) return {
5733
+ isError: false,
5734
+ text: formatGuidance
5735
+ };
5736
+ if (!isValid && (shouldValidate || hasBlurred)) return {
5737
+ isError: true,
5738
+ text: typeof errorMessage === "string" && errorMessage ? errorMessage : formatGuidance
5739
+ };
5781
5740
  return {
5782
5741
  isError: false
5783
5742
  };
@@ -5813,12 +5772,10 @@ const MaskedInputText = ({
5813
5772
  i18n
5814
5773
  } = useI18nContext();
5815
5774
  const onMismatch = (mismatch) => {
5816
- if (!inputRef.current)
5817
- return;
5775
+ if (!inputRef.current) return;
5818
5776
  setShowingMismatch(true);
5819
5777
  inputRef.current.addEventListener("animationend", (event) => {
5820
- if (event.animationName !== MISMATCH_ANIMATION_NAME)
5821
- return;
5778
+ if (event.animationName !== MISMATCH_ANIMATION_NAME) return;
5822
5779
  setShowingMismatch(false);
5823
5780
  });
5824
5781
  onMismatchExternal == null ? void 0 : onMismatchExternal(mismatch);
@@ -5829,16 +5786,14 @@ const MaskedInputText = ({
5829
5786
  }
5830
5787
  }, [mask]);
5831
5788
  const getMaskResult = useCallback((pureValue) => {
5832
- if (!mask)
5833
- return {
5834
- outcome: "partialCorrect",
5835
- displayValue: pureValue
5836
- };
5789
+ if (!mask) return {
5790
+ outcome: "partialCorrect",
5791
+ displayValue: pureValue
5792
+ };
5837
5793
  return matchAgainstMask(transformOnType ? transformOnType(pureValue) : pureValue, mask, acceptObscuredValue);
5838
5794
  }, [mask, transformOnType, acceptObscuredValue]);
5839
5795
  const displayValueToPure = useCallback((displayValue2) => {
5840
- if (!mask)
5841
- return displayValue2;
5796
+ if (!mask) return displayValue2;
5842
5797
  return displayValueToPureValue(displayValue2, mask);
5843
5798
  }, [mask]);
5844
5799
  const maskResult = useMemo(() => getMaskResult(value), [getMaskResult, value]);
@@ -5868,8 +5823,7 @@ Falling back to partially valid value "${fallback}"`);
5868
5823
  const newPureValue = displayValueToPure(inputEl.value);
5869
5824
  const newMaskResult = getMaskResult(newPureValue);
5870
5825
  const returnCaretLater = (offset = 0) => {
5871
- if (!inputEl.selectionStart)
5872
- return;
5826
+ if (!inputEl.selectionStart) return;
5873
5827
  setCaretReturnPosition(inputEl.selectionStart + offset);
5874
5828
  };
5875
5829
  const cancelInput = () => {
@@ -5914,8 +5868,7 @@ Falling back to partially valid value "${fallback}"`);
5914
5868
  selectionStart,
5915
5869
  selectionEnd
5916
5870
  } = inputEl;
5917
- if (!pasteValue || !selectionStart || selectionStart !== selectionEnd)
5918
- return;
5871
+ if (!pasteValue || !selectionStart || selectionStart !== selectionEnd) return;
5919
5872
  const pureDisplayValue = displayValueToPure(displayValue);
5920
5873
  const purePasteValue = displayValueToPure(pasteValue);
5921
5874
  const newPureValue = pureDisplayValue.slice(0, selectionStart) + purePasteValue + pureDisplayValue.slice(selectionStart);
@@ -5934,8 +5887,7 @@ Falling back to partially valid value "${fallback}"`);
5934
5887
  onKeyDown: (event) => {
5935
5888
  const inputEl = event.target;
5936
5889
  const isCaretAtEndWithNoSelection = inputEl.selectionStart === inputEl.value.length && inputEl.selectionStart === inputEl.selectionEnd;
5937
- if (event.key !== KEYBOARD_KEYS.backspace || !isCaretAtEndWithNoSelection)
5938
- return;
5890
+ if (event.key !== KEYBOARD_KEYS.backspace || !isCaretAtEndWithNoSelection) return;
5939
5891
  event.preventDefault();
5940
5892
  const withLastCharRemoved = value.slice(0, value.length - 1);
5941
5893
  const newMaskResult = getMaskResult(withLastCharRemoved);
@@ -6072,8 +6024,7 @@ const companyRegistrationNumberOptions = {
6072
6024
  };
6073
6025
  const getCompanyRegistrationNumberOptions = (country2, companyType2) => {
6074
6026
  const optionsForCountry = companyRegistrationNumberOptions[country2];
6075
- if (!companyType2 || !optionsForCountry)
6076
- return optionsForCountry;
6027
+ if (!companyType2 || !optionsForCountry) return optionsForCountry;
6077
6028
  return optionsForCountry.filter((option) => {
6078
6029
  var _a;
6079
6030
  return ((_a = option.applicableOnlyFor) == null ? void 0 : _a.includes(companyType2)) ?? true;
@@ -6139,8 +6090,7 @@ const taxIdNumberOptions = {
6139
6090
  };
6140
6091
  const getTaxIdNumberOptions = (country2, companyType2) => {
6141
6092
  const optionsForCountry = taxIdNumberOptions[country2];
6142
- if (!companyType2 || !optionsForCountry)
6143
- return optionsForCountry;
6093
+ if (!companyType2 || !optionsForCountry) return optionsForCountry;
6144
6094
  return optionsForCountry.filter((option) => {
6145
6095
  var _a;
6146
6096
  return ((_a = option.applicableOnlyFor) == null ? void 0 : _a.includes(companyType2)) ?? true;
@@ -6168,8 +6118,7 @@ function CompanyRegistrationNumberTypeSelector({
6168
6118
  }, [exemptedOption, setSelected]);
6169
6119
  const options = useMemo(() => {
6170
6120
  const availableOptions = getCompanyRegistrationNumberOptions(country2, companyType2) ?? [];
6171
- if (availableOptions.length === 0 || !exemptedOption)
6172
- return availableOptions;
6121
+ if (availableOptions.length === 0 || !exemptedOption) return availableOptions;
6173
6122
  return [...availableOptions, {
6174
6123
  id: "exempted",
6175
6124
  name: exemptedOption
@@ -6180,8 +6129,7 @@ function CompanyRegistrationNumberTypeSelector({
6180
6129
  setSelected(options[0].id);
6181
6130
  }
6182
6131
  }, [options, selected, setSelected]);
6183
- if (options.length <= 1)
6184
- return null;
6132
+ if (options.length <= 1) return null;
6185
6133
  return jsx(Field, {
6186
6134
  name: "companyRegistrationNumberType",
6187
6135
  label: i18n.get("whichTypeOfRegistrationNumberDoYouHave"),
@@ -7392,15 +7340,13 @@ const defaultFieldConfig$8 = {
7392
7340
  const inferCompanyRegistrationNumberType = (registrationNumber2, country2, companyType2) => {
7393
7341
  const optionsForCountry = companyRegistrationNumberOptions[country2];
7394
7342
  const metadataFn = defaultFieldConfig$8[country2];
7395
- if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function")
7396
- return void 0;
7343
+ if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function") return void 0;
7397
7344
  for (const option of optionsForCountry) {
7398
7345
  const fieldMetadata = metadataFn({
7399
7346
  companyType: companyType2,
7400
7347
  registrationNumberType: option.id
7401
7348
  });
7402
- if (!fieldMetadata.validators)
7403
- continue;
7349
+ if (!fieldMetadata.validators) continue;
7404
7350
  const validators = Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators];
7405
7351
  if (validators.every((validator) => validator.validate(registrationNumber2))) {
7406
7352
  return option.id;
@@ -8692,15 +8638,13 @@ const defaultFieldConfig$6 = {
8692
8638
  const inferTaxIdNumberType = (taxId2, country2) => {
8693
8639
  const optionsForCountry = taxIdNumberOptions[country2];
8694
8640
  const metadataFn = defaultFieldConfig$6[country2] ?? defaultFieldConfig$7[country2];
8695
- if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function")
8696
- return void 0;
8641
+ if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function") return void 0;
8697
8642
  for (const option of optionsForCountry) {
8698
8643
  const fieldMetadata = metadataFn({
8699
8644
  taxIdNumberType: option.id,
8700
8645
  vatNumberType: option.id
8701
8646
  });
8702
- if (!fieldMetadata.validators)
8703
- continue;
8647
+ if (!fieldMetadata.validators) continue;
8704
8648
  const validators = Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators];
8705
8649
  if (validators.every((validator) => validator.validate(taxId2))) {
8706
8650
  return option.id;
@@ -8729,8 +8673,7 @@ function TaxIdNumberTypeSelector({
8729
8673
  }, [exemptedOption, setSelected]);
8730
8674
  const options = useMemo(() => {
8731
8675
  const availableOptions = getTaxIdNumberOptions(country2, companyType2) ?? [];
8732
- if (availableOptions.length === 0 || !exemptedOption)
8733
- return availableOptions;
8676
+ if (availableOptions.length === 0 || !exemptedOption) return availableOptions;
8734
8677
  return [...availableOptions, {
8735
8678
  id: "exempted",
8736
8679
  name: exemptedOption
@@ -8741,8 +8684,7 @@ function TaxIdNumberTypeSelector({
8741
8684
  handleSelect(options[0].id);
8742
8685
  }
8743
8686
  }, [options, selected, handleSelect]);
8744
- if (options.length <= 1)
8745
- return null;
8687
+ if (options.length <= 1) return null;
8746
8688
  return jsx(Field, {
8747
8689
  name: "taxIdNumberType",
8748
8690
  label: i18n.get("whichTypeOfTaxIdNumberDoYouHave"),
@@ -8964,8 +8906,7 @@ function VatNumber(props) {
8964
8906
  }
8965
8907
  });
8966
8908
  }, [data, valid, errors, isValid]);
8967
- if (!formUtils.isRequiredField("vatNumber"))
8968
- return null;
8909
+ if (!formUtils.isRequiredField("vatNumber")) return null;
8969
8910
  const exemptionIsPossible = ((_b = mergedProps.requiredFields) == null ? void 0 : _b.includes("exemptedFromVat")) ?? false;
8970
8911
  const showTaxIdExemptedOption = exemptionIsPossible && ((_c = taxIdNumberOptions[country2]) == null ? void 0 : _c.length) > 1;
8971
8912
  const handleTaxIdNumberTypeChange = (taxIdType) => {
@@ -9913,10 +9854,9 @@ const EntityTypeSelectionRadioCardBody = ({
9913
9854
  const {
9914
9855
  i18n
9915
9856
  } = useI18nContext();
9916
- if (!examples)
9917
- return jsx("span", {
9918
- children: i18n.get(description2)
9919
- });
9857
+ if (!examples) return jsx("span", {
9858
+ children: i18n.get(description2)
9859
+ });
9920
9860
  return jsxs(Fragment, {
9921
9861
  children: [jsx("span", {
9922
9862
  className: "adyen-kyc-entity-type-radio-group-card__description",
@@ -9935,8 +9875,7 @@ const EntityTypeSelectionRadioCardBody = ({
9935
9875
  const CoreContext = createContext(void 0);
9936
9876
  const useCoreContext = () => {
9937
9877
  const context = useContext(CoreContext);
9938
- if (!context)
9939
- throw Error("You need a <CoreProvider> to use core context");
9878
+ if (!context) throw Error("You need a <CoreProvider> to use core context");
9940
9879
  return context;
9941
9880
  };
9942
9881
  var TrustMemberTypes = /* @__PURE__ */ ((TrustMemberTypes2) => {
@@ -10149,22 +10088,17 @@ function getNestedPropertyKeys(obj, includeUndefined = false) {
10149
10088
  return fieldNames;
10150
10089
  }
10151
10090
  const getTaskStatus = (type, capabilityProblems, rootLegalEntity, entityIds, skipPendingCapabilitiesCheck = false) => {
10152
- if (!(entityIds == null ? void 0 : entityIds.length) || entityIds.includes(rootLegalEntity.id) && isEmptyEntity(rootLegalEntity))
10153
- return TaskStatus.EMPTY;
10091
+ if (!(entityIds == null ? void 0 : entityIds.length) || entityIds.includes(rootLegalEntity.id) && isEmptyEntity(rootLegalEntity)) return TaskStatus.EMPTY;
10154
10092
  const importantCapabilityStatus = checkForImportantCapabilityStatus(type, capabilityProblems, entityIds);
10155
- if (importantCapabilityStatus)
10156
- return importantCapabilityStatus;
10157
- if (!skipPendingCapabilitiesCheck && hasPendingCapabilities(rootLegalEntity))
10158
- return TaskStatus.PROCESSING;
10093
+ if (importantCapabilityStatus) return importantCapabilityStatus;
10094
+ if (!skipPendingCapabilitiesCheck && hasPendingCapabilities(rootLegalEntity)) return TaskStatus.PROCESSING;
10159
10095
  return TaskStatus.FINISHED;
10160
10096
  };
10161
10097
  const IMPORTANT_STATUSES = [TaskStatus.DETAILS_REQUIRED, TaskStatus.DOWNLOAD, TaskStatus.ERROR, TaskStatus.PROCESSING];
10162
10098
  function checkForImportantCapabilityStatus(type, capabilityProblems, entityIds) {
10163
- if (!(capabilityProblems == null ? void 0 : capabilityProblems[type]) || !entityIds)
10164
- return;
10099
+ if (!(capabilityProblems == null ? void 0 : capabilityProblems[type]) || !entityIds) return;
10165
10100
  const importantStatuses = Object.entries(capabilityProblems[type]).filter(([key]) => entityIds.includes(key)).map(([, value]) => value.status).filter((status) => status !== void 0 && IMPORTANT_STATUSES.includes(status));
10166
- if (!importantStatuses.length)
10167
- return;
10101
+ if (!importantStatuses.length) return;
10168
10102
  return importantStatuses.reduce((prev, curr) => curr > prev ? curr : prev);
10169
10103
  }
10170
10104
  const hasPendingCapabilities = (legalEntityResponse) => Object.values(legalEntityResponse.capabilities ?? {}).some((capability) => capability.verificationStatus === "pending");
@@ -10183,14 +10117,11 @@ const emptyFieldsByEntityType = {
10183
10117
  function isEmptyEntity(legalEntity) {
10184
10118
  var _a;
10185
10119
  const type = legalEntity == null ? void 0 : legalEntity.type;
10186
- if (!type)
10187
- return true;
10188
- if ((_a = legalEntity.documentDetails) == null ? void 0 : _a.length)
10189
- return false;
10120
+ if (!type) return true;
10121
+ if ((_a = legalEntity.documentDetails) == null ? void 0 : _a.length) return false;
10190
10122
  const minimumFields = emptyFieldsByEntityType[type];
10191
10123
  const typeSpecificSection = legalEntity[type];
10192
- if (!typeSpecificSection)
10193
- return true;
10124
+ if (!typeSpecificSection) return true;
10194
10125
  const fieldsOnEntity = getNestedPropertyKeys(typeSpecificSection);
10195
10126
  return !fieldsOnEntity.some((field) => !minimumFields.includes(field));
10196
10127
  }
@@ -10201,9 +10132,11 @@ const entityTypeToCorrespondingAccountHolderOption = {
10201
10132
  [LegalEntityType.SOLE_PROPRIETORSHIP]: "mySoleProprietorName",
10202
10133
  [LegalEntityType.TRUST]: "aTrust"
10203
10134
  };
10204
- const getDefaultAccountHolderType = (legalEntityResponse, isTypeChanging = false) => {
10205
- if (!(legalEntityResponse == null ? void 0 : legalEntityResponse.type))
10206
- return void 0;
10135
+ const getDefaultAccountHolderType = (legalEntityResponse, isTypeChanging = false, accountHolder2) => {
10136
+ if (accountHolder2) {
10137
+ return accountHolder2;
10138
+ }
10139
+ if (!(legalEntityResponse == null ? void 0 : legalEntityResponse.type)) return void 0;
10207
10140
  if (hasOwnEntityAssociationOfType(LegalEntityType.SOLE_PROPRIETORSHIP, legalEntityResponse.entityAssociations, legalEntityResponse.id)) {
10208
10141
  return "mySoleProprietorName";
10209
10142
  }
@@ -10454,6 +10387,7 @@ const companyTypeValidationRules = {
10454
10387
  };
10455
10388
  const companyTypeFields = ["entityType", ...accountHolderFields];
10456
10389
  function CompanyTypeComponent(props) {
10390
+ var _a;
10457
10391
  const {
10458
10392
  i18n
10459
10393
  } = useI18nContext();
@@ -10484,8 +10418,8 @@ function CompanyTypeComponent(props) {
10484
10418
  const formUtils = formUtilities(props, i18n);
10485
10419
  const accountHolderProps = getFieldProps(props, accountHolderFields);
10486
10420
  useEffect(() => {
10487
- var _a, _b;
10488
- (_b = (_a = stateRef.current) == null ? void 0 : _a.setState) == null ? void 0 : _b.call(_a, {
10421
+ var _a2, _b;
10422
+ (_b = (_a2 = stateRef.current) == null ? void 0 : _a2.setState) == null ? void 0 : _b.call(_a2, {
10489
10423
  type: "addToState",
10490
10424
  value: {
10491
10425
  data,
@@ -10498,7 +10432,7 @@ function CompanyTypeComponent(props) {
10498
10432
  }
10499
10433
  });
10500
10434
  }, [data, valid, errors, isValid]);
10501
- const companyTypeOptions = isNewEntryFlowEnabled ? companyTypes.filter((companyType2) => companyType2.id !== CompanyTypesValue.INCORPORATED_PARTNERSHIP && companyType2.id !== CompanyTypesValue.INCORPORATED_ASSOCIATION) : companyTypes;
10435
+ const companyTypeOptions = isNewEntryFlowEnabled && ((_a = props.data) == null ? void 0 : _a.accountHolder) !== "aTrust" ? companyTypes.filter((companyType2) => companyType2.id !== CompanyTypesValue.INCORPORATED_PARTNERSHIP && companyType2.id !== CompanyTypesValue.INCORPORATED_ASSOCIATION) : companyTypes;
10502
10436
  const companyTypeExamples2 = useCompanyTypeExamples(country2);
10503
10437
  return jsxs(Fragment, {
10504
10438
  children: [jsx(StateContextSetter, {
@@ -10644,11 +10578,9 @@ function DocumentGuidance({
10644
10578
  }
10645
10579
  function bytesToSize(bytes) {
10646
10580
  const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
10647
- if (bytes === 0)
10648
- return "n/a";
10581
+ if (bytes === 0) return "n/a";
10649
10582
  const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)).toString());
10650
- if (i === 0)
10651
- return `${bytes} ${sizes[i]}`;
10583
+ if (i === 0) return `${bytes} ${sizes[i]}`;
10652
10584
  return `${(bytes / 1024 ** i).toFixed()} ${sizes[i]}`;
10653
10585
  }
10654
10586
  const isExistingFile = (file) => "existing" in file && file.existing;
@@ -10665,11 +10597,9 @@ function DropzoneFile(props) {
10665
10597
  } = useI18nContext();
10666
10598
  const formatSize = (bytes) => {
10667
10599
  const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
10668
- if (!bytes || bytes === 0)
10669
- return "n/a";
10600
+ if (!bytes || bytes === 0) return "n/a";
10670
10601
  const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)).toString());
10671
- if (i === 0)
10672
- return `${bytes} ${sizes[i]}`;
10602
+ if (i === 0) return `${bytes} ${sizes[i]}`;
10673
10603
  return `${(bytes / 1024 ** i).toFixed(1)} ${sizes[i]}`;
10674
10604
  };
10675
10605
  return jsxs("div", {
@@ -10725,40 +10655,35 @@ const fileValidationRules = ({
10725
10655
  isOptional
10726
10656
  }) => [{
10727
10657
  validate: (files) => {
10728
- if (isOptional && (!files || files.length === 0))
10729
- return true;
10658
+ if (isOptional && (!files || files.length === 0)) return true;
10730
10659
  return Boolean(files && files.length > 0);
10731
10660
  },
10732
10661
  errorMessage: "fieldIsRequired",
10733
10662
  modes: ["blur", "input"]
10734
10663
  }, {
10735
10664
  validate: (files) => {
10736
- if (!files)
10737
- return true;
10665
+ if (!files) return true;
10738
10666
  return files.length <= maxNumberOfFiles;
10739
10667
  },
10740
10668
  errorMessage: "tooManyFiles",
10741
10669
  modes: ["blur", "input"]
10742
10670
  }, {
10743
10671
  validate: (files) => {
10744
- if (!files)
10745
- return true;
10672
+ if (!files) return true;
10746
10673
  return !hasDuplicates(files.map((file) => file.name));
10747
10674
  },
10748
10675
  errorMessage: "duplicatedFiles",
10749
10676
  modes: ["blur", "input"]
10750
10677
  }, {
10751
10678
  validate: (files) => {
10752
- if (!files)
10753
- return true;
10679
+ if (!files) return true;
10754
10680
  return filterOnlyNewlyUploadedFiles(files).every((file) => allowedFileTypes.some((filetype) => file.name.toLowerCase().endsWith(filetype.toLowerCase())));
10755
10681
  },
10756
10682
  errorMessage: "unsupportedFiletype",
10757
10683
  modes: ["blur", "input"]
10758
10684
  }, {
10759
10685
  validate: (files) => {
10760
- if (!files)
10761
- return true;
10686
+ if (!files) return true;
10762
10687
  return filterOnlyNewlyUploadedFiles(files).every((file) => !file.size || file.size < maxSize);
10763
10688
  },
10764
10689
  errorMessage: "maximumFileSizeExceeded",
@@ -11080,10 +11005,9 @@ function DocumentUploadComponent({
11080
11005
  }, [data, valid, errors, fieldProblems]);
11081
11006
  useEffect(() => {
11082
11007
  var _a2, _b;
11083
- if (documentField)
11084
- setDocument({
11085
- [documentField]: (_a2 = props == null ? void 0 : props.data) == null ? void 0 : _a2[documentField]
11086
- });
11008
+ if (documentField) setDocument({
11009
+ [documentField]: (_a2 = props == null ? void 0 : props.data) == null ? void 0 : _a2[documentField]
11010
+ });
11087
11011
  setData("description", (_b = props.data) == null ? void 0 : _b.description);
11088
11012
  triggerValidation();
11089
11013
  }, [props.data]);
@@ -11288,8 +11212,7 @@ function StateField({
11288
11212
  } = useDataset(datasetIdentifier.state(selectedCountry), !selectedCountry || !COUNTRIES_WITH_STATES_DATASET.includes(selectedCountry));
11289
11213
  const labelKey = getKeyForField("stateOrProvince", selectedCountry);
11290
11214
  const placeholderKey = getKeyForField("stateOrProvincePlaceholder", selectedCountry);
11291
- if (!loaded || !states.length)
11292
- return null;
11215
+ if (!loaded || !states.length) return null;
11293
11216
  return jsx(Field, {
11294
11217
  name: "stateOrProvince",
11295
11218
  label: (labels2 == null ? void 0 : labels2.stateOrProvince) || i18n.get(labelKey),
@@ -11403,14 +11326,12 @@ function useIsElementVisible(ref, fallback = true) {
11403
11326
  const [isOnScreen, setIsOnScreen] = useState(isIntersectionObserverSupported ? false : fallback);
11404
11327
  const observerRef = useRef();
11405
11328
  useEffect(() => {
11406
- if (!isIntersectionObserverSupported)
11407
- return;
11329
+ if (!isIntersectionObserverSupported) return;
11408
11330
  observerRef.current = new IntersectionObserver(([entry]) => setIsOnScreen(entry.isIntersecting));
11409
11331
  }, []);
11410
11332
  useEffect(() => {
11411
11333
  var _a;
11412
- if (!ref.current)
11413
- return;
11334
+ if (!ref.current) return;
11414
11335
  (_a = observerRef.current) == null ? void 0 : _a.observe(ref.current);
11415
11336
  return () => {
11416
11337
  var _a2;
@@ -11846,8 +11767,7 @@ const countrySpecificFormatters = {
11846
11767
  postalCode: {
11847
11768
  // Formatter - excludes non digits & hyphens and limits to a maxlength that varies depending on whether a hyphen is present or not
11848
11769
  formatter: (val) => {
11849
- if (!val)
11850
- return void 0;
11770
+ if (!val) return void 0;
11851
11771
  const nuVal = val.replace(getFormattingRegEx("^\\d-", "g"), "");
11852
11772
  const maxlength = nuVal.includes("-") ? 6 : 5;
11853
11773
  return nuVal.substring(0, maxlength);
@@ -11859,8 +11779,7 @@ const countrySpecificFormatters = {
11859
11779
  [CountryCodes.Portugal]: {
11860
11780
  postalCode: {
11861
11781
  formatter: (val) => {
11862
- if (!val)
11863
- return void 0;
11782
+ if (!val) return void 0;
11864
11783
  const nuVal = val.replace(getFormattingRegEx("^\\d-", "g"), "");
11865
11784
  return nuVal.substring(0, 8);
11866
11785
  },
@@ -12078,8 +11997,7 @@ function Address(props) {
12078
11997
  }
12079
11998
  }, [shouldValidate]);
12080
11999
  const getComponent = (fieldName) => {
12081
- if (!formUtils.isRequiredField(fieldName))
12082
- return null;
12000
+ if (!formUtils.isRequiredField(fieldName)) return null;
12083
12001
  const hideField = fieldName === "country" && hideCountry;
12084
12002
  return jsx(FieldContainer, {
12085
12003
  classNameModifiers: [fieldName],
@@ -12089,7 +12007,7 @@ function Address(props) {
12089
12007
  fieldProblems,
12090
12008
  fieldName,
12091
12009
  handleChangeFor,
12092
- maxlength: getMaxLengthByFieldAndCountry(countrySpecificFormatters, fieldName, data.country, true),
12010
+ maxlength: getMaxLengthByFieldAndCountry(countrySpecificFormatters, fieldName, data.country),
12093
12011
  hideField,
12094
12012
  "aria-label": formUtils.getLabel(fieldName, fieldName),
12095
12013
  trimOnBlur: true
@@ -12837,8 +12755,7 @@ const uploadDocuments = async (documents2, entityId) => {
12837
12755
  return documentStore[entityId];
12838
12756
  };
12839
12757
  const updateEntityDocuments = (uploadedDocuments, entityId) => {
12840
- if (!documentStore[entityId])
12841
- documentStore[entityId] = [];
12758
+ if (!documentStore[entityId]) documentStore[entityId] = [];
12842
12759
  uploadedDocuments.forEach((uploadedDocument) => {
12843
12760
  if (uploadedDocument) {
12844
12761
  const existingDocumentIndex = documentStore[entityId].findIndex((document2) => document2.id === uploadedDocument.id);
@@ -13461,7 +13378,7 @@ const mapIndividualToLegalEntity = (data) => {
13461
13378
  }
13462
13379
  return requestObj;
13463
13380
  };
13464
- const mapLegalEntityToCompany = (legalEntity, isChangingType) => {
13381
+ const mapLegalEntityToCompany = (legalEntity, isChangingType, accountHolder2) => {
13465
13382
  var _a, _b, _c, _d;
13466
13383
  let companyCompData;
13467
13384
  if (legalEntity == null ? void 0 : legalEntity.organization) {
@@ -13506,7 +13423,7 @@ const mapLegalEntityToCompany = (legalEntity, isChangingType) => {
13506
13423
  ...companyCompData,
13507
13424
  companyType: {
13508
13425
  ...companyCompData == null ? void 0 : companyCompData.companyType,
13509
- accountHolder: getDefaultAccountHolderType(legalEntity, isChangingType)
13426
+ accountHolder: getDefaultAccountHolderType(legalEntity, isChangingType, accountHolder2)
13510
13427
  }
13511
13428
  };
13512
13429
  return companyCompData;
@@ -13643,11 +13560,9 @@ const mapSolePropToLegalEntity = (data) => {
13643
13560
  const getPage = ({
13644
13561
  attachments
13645
13562
  }, pageType) => {
13646
- if (!attachments)
13647
- throw Error("Document has no attachments");
13563
+ if (!attachments) throw Error("Document has no attachments");
13648
13564
  const attachment = pageType ? attachments.find((attach) => attach.pageType === pageType) : attachments[0];
13649
- if (!attachment)
13650
- throw Error(`Attachment not found${pageType ? ` with type '${pageType}'` : ""}`);
13565
+ if (!attachment) throw Error(`Attachment not found${pageType ? ` with type '${pageType}'` : ""}`);
13651
13566
  return attachment;
13652
13567
  };
13653
13568
  const getPageName = (document2, pageType) => getPage(document2, pageType).pageName;
@@ -14043,8 +13958,7 @@ const useIdVerificationToken = ({
14043
13958
  const hasAllUserDetails = userDetails && Object.values(userDetails).every(Boolean);
14044
13959
  useEffect(() => {
14045
13960
  (async () => {
14046
- if (!hasAllUserDetails)
14047
- return;
13961
+ if (!hasAllUserDetails) return;
14048
13962
  try {
14049
13963
  setLoadingStatus("loading");
14050
13964
  const data = {
@@ -14205,8 +14119,7 @@ function IdVerificationComponent({
14205
14119
  const onfidoSdk = useRef();
14206
14120
  useEffect(() => {
14207
14121
  (async () => {
14208
- if (!sdkToken2)
14209
- return;
14122
+ if (!sdkToken2) return;
14210
14123
  onfidoSdk.current = await initOnfido({
14211
14124
  token: sdkToken2,
14212
14125
  i18n,
@@ -14216,13 +14129,11 @@ function IdVerificationComponent({
14216
14129
  });
14217
14130
  })().catch(logger$m.error);
14218
14131
  return () => {
14219
- if (onfidoSdk.current)
14220
- onfidoSdk.current.tearDown();
14132
+ if (onfidoSdk.current) onfidoSdk.current.tearDown();
14221
14133
  };
14222
14134
  }, [sdkToken2]);
14223
14135
  useEffect(() => {
14224
- if (!onfidoSdk.current)
14225
- return;
14136
+ if (!onfidoSdk.current) return;
14226
14137
  onfidoSdk.current.setOptions({
14227
14138
  language: getOnfidoLocaleConfig(i18n)
14228
14139
  });
@@ -14388,8 +14299,7 @@ const layoutBreakpointSizes = {
14388
14299
  const getBreakpointClassNames = (containerSize) => {
14389
14300
  const breakPoints = Object.entries(layoutBreakpointSizes);
14390
14301
  const classes = breakPoints.reduce((acc, [bp, size]) => {
14391
- if (size <= containerSize)
14392
- acc.push(layoutBreakpointClassnames[bp]);
14302
+ if (size <= containerSize) acc.push(layoutBreakpointClassnames[bp]);
14393
14303
  return acc;
14394
14304
  }, []);
14395
14305
  return classes.length > 0 ? classes : ["adyen-layout-xs-only"];
@@ -14414,8 +14324,7 @@ const AutoResizer = ({
14414
14324
  const containerRef = useRef(null);
14415
14325
  useEffect(() => {
14416
14326
  const container = containerRef.current;
14417
- if (!container)
14418
- return;
14327
+ if (!container) return;
14419
14328
  const resizeObserver = new ResizeObserver((entries) => assignLayoutClasses(entries, container));
14420
14329
  resizeObserver.observe(container);
14421
14330
  return () => resizeObserver.unobserve(container);
@@ -14660,8 +14569,7 @@ function useVerification(fieldsToVerify, country2) {
14660
14569
  const verificationPromises = [];
14661
14570
  fieldsToVerify.forEach((field) => {
14662
14571
  if (field === "idNumber" && formState.data[field]) {
14663
- if (formState.data[field] === savedData[field] || country2 === "US" && formState.data[field].length === 4)
14664
- return;
14572
+ if (formState.data[field] === savedData[field] || country2 === "US" && formState.data[field].length === 4) return;
14665
14573
  const request = {
14666
14574
  name: {
14667
14575
  firstName: formState.data.firstName,
@@ -14697,10 +14605,8 @@ function InputTelephone(props) {
14697
14605
  const staticPhoneValidationRules = (phonePrefixes, defaultPrefix) => ({
14698
14606
  phoneNumber: {
14699
14607
  validate: (phoneNumber2) => {
14700
- if (!phoneNumber2)
14701
- return false;
14702
- if (!phonePrefixes.length)
14703
- return phoneNumber2.startsWith("+");
14608
+ if (!phoneNumber2) return false;
14609
+ if (!phonePrefixes.length) return phoneNumber2.startsWith("+");
14704
14610
  return phonePrefixes.map((prefix) => prefix.name).some((name) => phoneNumber2.startsWith(name));
14705
14611
  },
14706
14612
  errorMessage: {
@@ -14720,8 +14626,7 @@ const useAsyncPhoneValidationRules = () => {
14720
14626
  phoneNumber: {
14721
14627
  asyncValidate: async (phoneNumber2) => {
14722
14628
  var _a;
14723
- if (!phoneNumber2)
14724
- return false;
14629
+ if (!phoneNumber2) return false;
14725
14630
  return (_a = await validatePhoneNumber2(phoneNumber2)) == null ? void 0 : _a.valid;
14726
14631
  },
14727
14632
  errorMessage: "invalidPhoneNumber",
@@ -15450,8 +15355,7 @@ function IdentityNumberComponent(props) {
15450
15355
  ...data
15451
15356
  };
15452
15357
  adjustedData.idNumber = data.idNumberExempt ? void 0 : data.idNumber;
15453
- if (data.idNumberExempt && formErrors.idNumber !== null)
15454
- setFormErrors("idNumber", null);
15358
+ if (data.idNumberExempt && formErrors.idNumber !== null) setFormErrors("idNumber", null);
15455
15359
  (_b = (_a = stateRef.current) == null ? void 0 : _a.setState) == null ? void 0 : _b.call(_a, {
15456
15360
  type: "addToState",
15457
15361
  value: {
@@ -15571,8 +15475,7 @@ const getRoleName = (role2) => {
15571
15475
  };
15572
15476
  const makeSelectItemForRole = (role2, i18n) => {
15573
15477
  const metadata = roleMetadata[role2];
15574
- if (!metadata)
15575
- throw Error(`Cannot make select item for role "${role2}"; no metadata found. Valid roles include: ${Object.keys(roleMetadata).join("\n")}`);
15478
+ if (!metadata) throw Error(`Cannot make select item for role "${role2}"; no metadata found. Valid roles include: ${Object.keys(roleMetadata).join("\n")}`);
15576
15479
  const {
15577
15480
  name,
15578
15481
  description: description2,
@@ -15586,11 +15489,9 @@ const makeSelectItemForRole = (role2, i18n) => {
15586
15489
  };
15587
15490
  };
15588
15491
  const handleKeys = (keys, callback, propagationMode = "stopIfMatches") => (event) => {
15589
- if (propagationMode === "stop")
15590
- event.stopPropagation();
15492
+ if (propagationMode === "stop") event.stopPropagation();
15591
15493
  if (keys.includes(event.key)) {
15592
- if (propagationMode === "stopIfMatches")
15593
- event.stopPropagation();
15494
+ if (propagationMode === "stopIfMatches") event.stopPropagation();
15594
15495
  callback();
15595
15496
  }
15596
15497
  };
@@ -15719,8 +15620,7 @@ function IndividualIdNumberTypeSelector({
15719
15620
  setSelected(options[0].id);
15720
15621
  }
15721
15622
  }, [options, selected, setSelected]);
15722
- if (options.length <= 1)
15723
- return null;
15623
+ if (options.length <= 1) return null;
15724
15624
  return jsx(Field, {
15725
15625
  name: "individualIdNumberType",
15726
15626
  label: i18n.get("whichTypeOfIdNumberDoYouHave"),
@@ -17163,14 +17063,12 @@ function FilePicker({
17163
17063
  const handleDrop = (e) => {
17164
17064
  e.preventDefault();
17165
17065
  e.stopPropagation();
17166
- if (e.dataTransfer)
17167
- addFiles(e.dataTransfer.files);
17066
+ if (e.dataTransfer) addFiles(e.dataTransfer.files);
17168
17067
  setDragged(false);
17169
17068
  };
17170
17069
  const handleFilesChosen = (e) => {
17171
17070
  const fileInput2 = e.target;
17172
- if (fileInput2.files)
17173
- addFiles(fileInput2.files);
17071
+ if (fileInput2.files) addFiles(fileInput2.files);
17174
17072
  };
17175
17073
  const addFiles = (newFiles) => {
17176
17074
  setFiles([...newFiles, ...files]);
@@ -17503,8 +17401,7 @@ function BankDocument(props) {
17503
17401
  var _a2;
17504
17402
  if (hasAlreadyUploadedDocuments) {
17505
17403
  setData("bankStatementDocument", alreadyUploadedDocuments);
17506
- if ((_a2 = props.data) == null ? void 0 : _a2.description)
17507
- setData("description", props.data.description);
17404
+ if ((_a2 = props.data) == null ? void 0 : _a2.description) setData("description", props.data.description);
17508
17405
  triggerValidation();
17509
17406
  }
17510
17407
  }, [alreadyUploadedDocuments, hasAlreadyUploadedDocuments, (_b = props.data) == null ? void 0 : _b.description, setData, triggerValidation]);
@@ -17949,12 +17846,10 @@ const httpPost = async (options, data) => http({
17949
17846
  }, data);
17950
17847
  const removeElementSiblings = (element) => {
17951
17848
  const parent = element.parentNode;
17952
- if (!parent)
17953
- return;
17849
+ if (!parent) return;
17954
17850
  let child = parent.firstChild;
17955
17851
  while (child) {
17956
- if (child !== element)
17957
- parent.removeChild(child);
17852
+ if (child !== element) parent.removeChild(child);
17958
17853
  child = child.nextSibling;
17959
17854
  }
17960
17855
  };
@@ -17968,8 +17863,7 @@ const isTerminalMessageData = (data) => isObjectData(data) && Object.entries(dat
17968
17863
  const parseMessageJson = (message) => {
17969
17864
  try {
17970
17865
  const messageData = JSON.parse(message);
17971
- if (!RELEVANT_MESSAGE_TYPES.includes(messageData.type))
17972
- return "invalid";
17866
+ if (!RELEVANT_MESSAGE_TYPES.includes(messageData.type)) return "invalid";
17973
17867
  return messageData;
17974
17868
  } catch {
17975
17869
  return "invalid";
@@ -17996,8 +17890,7 @@ class IFrameWidget {
17996
17890
  this.listener = async (message) => {
17997
17891
  try {
17998
17892
  const result = await this.handleMessage(message);
17999
- if (!result)
18000
- return;
17893
+ if (!result) return;
18001
17894
  resolve(result);
18002
17895
  } catch (err) {
18003
17896
  reject(err);
@@ -18016,8 +17909,7 @@ class IFrameWidget {
18016
17909
  this.sdkToken = sdkToken2;
18017
17910
  }
18018
17911
  removeMessageEventListener() {
18019
- if (!this.listener)
18020
- return;
17912
+ if (!this.listener) return;
18021
17913
  window.removeEventListener("message", this.listener);
18022
17914
  this.listener = void 0;
18023
17915
  }
@@ -18026,19 +17918,16 @@ class IFrameWidget {
18026
17918
  origin,
18027
17919
  source
18028
17920
  }) {
18029
- if (source !== this.iframeWindow || origin !== this.iframeUrl.origin)
18030
- return;
17921
+ if (source !== this.iframeWindow || origin !== this.iframeUrl.origin) return;
18031
17922
  if (this.vendor !== TINK_VENDOR && isTerminalMessageData(data)) {
18032
17923
  if (Object.getOwnPropertyNames(data).includes("error")) {
18033
17924
  throw data;
18034
17925
  }
18035
17926
  return data;
18036
17927
  }
18037
- if (!isString(data))
18038
- return;
17928
+ if (!isString(data)) return;
18039
17929
  const jsonData = parseMessageJson(data);
18040
- if (jsonData === "invalid")
18041
- return;
17930
+ if (jsonData === "invalid") return;
18042
17931
  const httpOptions = {
18043
17932
  errorHandler: callbackErrorHandler,
18044
17933
  loadingContext: "",
@@ -18060,8 +17949,7 @@ class IFrameWidget {
18060
17949
  ...httpOptions,
18061
17950
  path: redirectUrl.href
18062
17951
  });
18063
- if (isVerifiedAccountsData(responseData))
18064
- return responseData;
17952
+ if (isVerifiedAccountsData(responseData)) return responseData;
18065
17953
  throw responseData;
18066
17954
  } catch (reason) {
18067
17955
  throw new AdyenKycSdkError("WIDGET_ACCOUNT_COMMIT_FAILURE", reason);
@@ -18120,8 +18008,7 @@ class IFrameWidget {
18120
18008
  reject(new AdyenKycSdkError("WIDGET_TIMEOUT"));
18121
18009
  }, MOUNT_TIMEOUT);
18122
18010
  const cancelTimeout = () => {
18123
- if (timeoutId)
18124
- clearTimeout(timeoutId);
18011
+ if (timeoutId) clearTimeout(timeoutId);
18125
18012
  };
18126
18013
  this.iframeElement.addEventListener("load", () => {
18127
18014
  cancelTimeout();
@@ -18293,8 +18180,6 @@ const useInstantVerificationErrorNotification = (notificationVisibilityDuration)
18293
18180
  useEffect(() => {
18294
18181
  clearNotificationTimeout();
18295
18182
  if (errorNotification) {
18296
- if (notificationVisibilityDuration <= 0)
18297
- return;
18298
18183
  dismissNotificationTimeoutRef.current = setTimeout(() => {
18299
18184
  setErrorNotification(null);
18300
18185
  clearNotificationTimeout();
@@ -18360,8 +18245,7 @@ function InstantBankVerification({
18360
18245
  content: errorContent
18361
18246
  });
18362
18247
  }
18363
- if (onBack)
18364
- onBack();
18248
+ if (onBack) onBack();
18365
18249
  break;
18366
18250
  }
18367
18251
  case "retry_verification":
@@ -18369,8 +18253,7 @@ function InstantBankVerification({
18369
18253
  title: i18n.get("failedInitializeInstantVerification"),
18370
18254
  content: errorContent
18371
18255
  });
18372
- if (onBack)
18373
- onBack();
18256
+ if (onBack) onBack();
18374
18257
  break;
18375
18258
  default: {
18376
18259
  const {
@@ -19157,8 +19040,7 @@ const customPrefixByCountry = {
19157
19040
  [CountryCodes.IsleOfMan]: "GB"
19158
19041
  };
19159
19042
  function ibanValidator(input, bankCountry2) {
19160
- if (isEmpty(input))
19161
- return false;
19043
+ if (isEmpty(input)) return false;
19162
19044
  const ibanInput = input.replace(/ /g, "").toUpperCase();
19163
19045
  if (!/^([a-zA-Z0-9]{4} ){2,8}[a-zA-Z0-9]{1,4}|[a-zA-Z0-9]{12,34}$/.test(ibanInput)) {
19164
19046
  return false;
@@ -19717,11 +19599,9 @@ const getMustHaveSameAccountHolderNameText = (legalEntityType, accountHolderName
19717
19599
  }
19718
19600
  };
19719
19601
  const getInstantVerificationProvider = (bankVerificationProviders, bankCountry2) => {
19720
- if (!bankVerificationProviders)
19721
- return "loading";
19602
+ if (!bankVerificationProviders) return "loading";
19722
19603
  const providerForCountry = bankVerificationProviders[bankCountry2];
19723
- if (!providerForCountry)
19724
- return void 0;
19604
+ if (!providerForCountry) return void 0;
19725
19605
  return providerForCountry.toLowerCase();
19726
19606
  };
19727
19607
  function PayoutVerificationMethod(props) {
@@ -20433,8 +20313,7 @@ const PER_COUNTRY_DECISION_MAKER_REQUIREMENTS_OVERRIDES = {
20433
20313
  }]
20434
20314
  };
20435
20315
  const getDecisionMakerRequirements = (country2) => {
20436
- if (!country2)
20437
- return DEFAULT_DECISION_MAKER_REQUIREMENTS;
20316
+ if (!country2) return DEFAULT_DECISION_MAKER_REQUIREMENTS;
20438
20317
  return PER_COUNTRY_DECISION_MAKER_REQUIREMENTS_OVERRIDES[country2] ?? DEFAULT_DECISION_MAKER_REQUIREMENTS;
20439
20318
  };
20440
20319
  function getAvailableDecisionMakerRoleTypes(country2) {
@@ -20464,8 +20343,7 @@ const getDecisionMakerDescriptionMap = (country2) => ({
20464
20343
  ...PER_COUNTRY_DESCRIPTION_OVERRIDES[country2]
20465
20344
  });
20466
20345
  const getOwnDecisionMakers = (rootLegalEntity) => {
20467
- if (!(rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations))
20468
- return [];
20346
+ if (!(rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations)) return [];
20469
20347
  return rootLegalEntity.entityAssociations.filter((entityAssociation) => Object.values(DecisionMakerType).includes(entityAssociation.type) && entityAssociation.associatorId === rootLegalEntity.id);
20470
20348
  };
20471
20349
  const getDecisionMakers = (rootLegalEntity, companyLegalEntityId) => getDirectEntityAssociations(rootLegalEntity, companyLegalEntityId).filter((association2) => Object.values(DecisionMakerType).includes(association2.type));
@@ -20522,8 +20400,7 @@ const isPartOfTrustFromLegalEntity = (legalEntity) => {
20522
20400
  };
20523
20401
  const getOwnTrustMembersLegalEntityIds = (rootLegalEntity) => {
20524
20402
  const trustLegalEntityId = getOwnTrustLegalEntityId(rootLegalEntity);
20525
- if (!trustLegalEntityId)
20526
- return [];
20403
+ if (!trustLegalEntityId) return [];
20527
20404
  const trustMemberAssociations = getDirectEntityAssociations(rootLegalEntity, trustLegalEntityId);
20528
20405
  const trustMemberIds = trustMemberAssociations.map((association2) => association2.legalEntityId).filter((id2) => id2 !== void 0);
20529
20406
  return [...trustMemberIds, ...trustMemberIds.flatMap((trustMemberId) => getTrustMemberCompanyDecisionMakerIds(rootLegalEntity, trustMemberId))];
@@ -20697,8 +20574,7 @@ function TrustRegistrationDetailsComponent(props) {
20697
20574
  classNameModifiers: ["country"],
20698
20575
  handleChangeFor: () => (e) => {
20699
20576
  handleChangeFor("country", "input")(e);
20700
- if (onCountryChange)
20701
- onCountryChange(e);
20577
+ if (onCountryChange) onCountryChange(e);
20702
20578
  }
20703
20579
  }), formUtils.isRequiredField("legalName") && jsx(Field, {
20704
20580
  name: "legalName",
@@ -21657,8 +21533,7 @@ const getOpeningStep = (forms2, remediationActions) => {
21657
21533
  var _a2;
21658
21534
  return (form2 == null ? void 0 : form2.formId) === ((_a2 = allRemediationActions[0]) == null ? void 0 : _a2.forms[0]);
21659
21535
  });
21660
- if (form)
21661
- return form;
21536
+ if (form) return form;
21662
21537
  }
21663
21538
  return forms2[forms2.length - 1];
21664
21539
  }
@@ -21691,8 +21566,7 @@ const useFormComposer = ({
21691
21566
  }) => formId === activeForm2.formId) ?? activeForm2);
21692
21567
  }, [forms2]);
21693
21568
  useEffect(() => {
21694
- if (hasAlreadyNavigatedForm)
21695
- return;
21569
+ if (hasAlreadyNavigatedForm) return;
21696
21570
  const openingStep = getOpeningStep(forms2, problems == null ? void 0 : problems.remediationActions);
21697
21571
  if (activeForm !== openingStep) {
21698
21572
  setActiveForm(openingStep);
@@ -21871,14 +21745,12 @@ const useScenarioConfiguration = ({
21871
21745
  }, [getConfigurationData, setLoadingStatus]);
21872
21746
  useEffect(() => {
21873
21747
  setLoadingStatus("loading");
21874
- if (!getPayoutAccountFormatData)
21875
- return;
21748
+ if (!getPayoutAccountFormatData) return;
21876
21749
  const makePayoutFormatCallAndSave = async () => {
21877
21750
  try {
21878
21751
  const response = await getPayoutAccountFormatData();
21879
21752
  setAccountFormatResponse(response);
21880
- if (!response)
21881
- return;
21753
+ if (!response) return;
21882
21754
  const allowedBankAccountFormats = Object.keys(response);
21883
21755
  if (existingBankAccountFormat && !allowedBankAccountFormats.includes(existingBankAccountFormat)) {
21884
21756
  throw new AdyenKycSdkError(`Account format, ${existingBankAccountFormat}, of transferInstrument is not in allowed formats for ${country2}`);
@@ -21898,8 +21770,7 @@ const useScenarioConfiguration = ({
21898
21770
  bankVerificationVendors,
21899
21771
  requiredFields
21900
21772
  } = useMemo(() => {
21901
- if (!configurationResponse)
21902
- return {};
21773
+ if (!configurationResponse) return {};
21903
21774
  const {
21904
21775
  matchingScenario,
21905
21776
  bankVerificationProviders
@@ -22195,8 +22066,7 @@ function parsePayoutScenarios({
22195
22066
  country: country2,
22196
22067
  bankVerificationAvailable
22197
22068
  }) {
22198
- if (!requiredFields)
22199
- return;
22069
+ if (!requiredFields) return;
22200
22070
  const fieldConfigurations = {};
22201
22071
  fieldConfigurations.payoutVerificationMethod = {
22202
22072
  rule: "REQUIRED"
@@ -22488,8 +22358,7 @@ const getFieldsWithExistingData = (legalEntity, isExperimentEnabled) => {
22488
22358
  var _a;
22489
22359
  const apiFieldsWithExistingData = getNestedPropertyKeys(legalEntity);
22490
22360
  const legalEntityType = legalEntity.type;
22491
- if (!legalEntityType)
22492
- return [];
22361
+ if (!legalEntityType) return [];
22493
22362
  const nonDocumentFields = apiFieldsWithExistingData.map((field) => convertApiFieldNameToSchemaFieldName(field, legalEntityType, isExperimentEnabled)).filter((field) => field !== void 0).filter((field) => !knownProblematicFields.includes(field));
22494
22363
  if ((_a = legalEntity.documentDetails) == null ? void 0 : _a.length) {
22495
22364
  const documentFields = legalEntity.documentDetails.map((document2) => legalEntityDocumentToFieldMapping[legalEntityType][document2.type]).filter((field) => field !== void 0);
@@ -22622,23 +22491,35 @@ const mapLegalArrangementOptionToCompanyTypesValue = (legalArrangement) => {
22622
22491
  case "associationIncorporated":
22623
22492
  return CompanyTypesValue.INCORPORATED_ASSOCIATION;
22624
22493
  default:
22494
+ return void 0;
22495
+ }
22496
+ };
22497
+ const determineOrganizationTypeToUpdate = (defaultLegalArrangement, targetLegalArrangement, currentCompanyTypeValue) => {
22498
+ if (targetLegalArrangement === "aTrust") {
22499
+ return;
22500
+ }
22501
+ if (!targetLegalArrangement) {
22502
+ const isUnavailableTypesInCompany = currentCompanyTypeValue === CompanyTypesValue.INCORPORATED_ASSOCIATION || currentCompanyTypeValue === CompanyTypesValue.INCORPORATED_PARTNERSHIP;
22503
+ if (isUnavailableTypesInCompany) {
22625
22504
  return "";
22505
+ }
22626
22506
  }
22507
+ return mapLegalArrangementOptionToCompanyTypesValue(targetLegalArrangement);
22627
22508
  };
22628
22509
  const getDefaultLegalArrangementOrSuborganizationType = (legalEntityResponse, accountHolder2) => {
22629
22510
  var _a;
22630
22511
  const entityAssociations = legalEntityResponse == null ? void 0 : legalEntityResponse.entityAssociations;
22631
22512
  const suborganizationType = (_a = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _a.type;
22513
+ const hasTrust = hasOwnEntityAssociationOfType(LegalEntityType.TRUST, entityAssociations, legalEntityResponse == null ? void 0 : legalEntityResponse.id);
22514
+ if (hasTrust || accountHolder2 === "aTrust") {
22515
+ return "aTrust";
22516
+ }
22632
22517
  if (suborganizationType === CompanyTypesValue.INCORPORATED_PARTNERSHIP) {
22633
22518
  return "partnershipIncorporated";
22634
22519
  }
22635
22520
  if (suborganizationType === CompanyTypesValue.INCORPORATED_ASSOCIATION) {
22636
22521
  return "associationIncorporated";
22637
22522
  }
22638
- const hasTrust = hasOwnEntityAssociationOfType(LegalEntityType.TRUST, entityAssociations, legalEntityResponse == null ? void 0 : legalEntityResponse.id);
22639
- if (hasTrust || accountHolder2 === "aTrust") {
22640
- return "aTrust";
22641
- }
22642
22523
  return void 0;
22643
22524
  };
22644
22525
  const getTargetLegalEntityType = (businessType, legalArrangement, trusteeType, currentLegalEntityType) => {
@@ -22648,11 +22529,12 @@ const getTargetLegalEntityType = (businessType, legalArrangement, trusteeType, c
22648
22529
  if (businessType === "legalArrangement" && legalArrangement === "aTrust" && trusteeType === "individual" || businessType === "individual" || businessType === "soleProprietorship") {
22649
22530
  return LegalEntityType.INDIVIDUAL;
22650
22531
  }
22651
- if (legalArrangement === "partnershipIncorporated") {
22532
+ if (legalArrangement && isLegalArrangementOrganizationSubtype(legalArrangement)) {
22652
22533
  return LegalEntityType.ORGANIZATION;
22653
22534
  }
22654
22535
  return currentLegalEntityType;
22655
22536
  };
22537
+ const isLegalArrangementOrganizationSubtype = (legalArrangementOption) => legalArrangementOption === "partnershipIncorporated" || legalArrangementOption === "associationIncorporated";
22656
22538
  var ToastType = /* @__PURE__ */ ((ToastType2) => {
22657
22539
  ToastType2["LOADING"] = "loading";
22658
22540
  ToastType2["SUCCESS"] = "success";
@@ -22752,8 +22634,7 @@ function FormNavigation({
22752
22634
  } = useI18nContext();
22753
22635
  const getFormIndex = (form) => forms2.findIndex((f) => f.formId === form.formId);
22754
22636
  const goToForm = (form) => () => {
22755
- if (form.formId === activeForm.formId)
22756
- return;
22637
+ if (form.formId === activeForm.formId) return;
22757
22638
  gotoForm(getFormIndex(form));
22758
22639
  trackNavigation2({
22759
22640
  fromForm: form,
@@ -22962,7 +22843,8 @@ function CompanyDropinComponent({
22962
22843
  handleUpdateLegalEntity,
22963
22844
  handleHomeClick,
22964
22845
  onTypeSwitch,
22965
- onChange
22846
+ onChange,
22847
+ accountHolder: accountHolder2
22966
22848
  }) {
22967
22849
  var _a, _b;
22968
22850
  const {
@@ -22979,7 +22861,8 @@ function CompanyDropinComponent({
22979
22861
  i18n,
22980
22862
  setLocale
22981
22863
  } = useI18nContext();
22982
- const dataFromResponse = mapLegalEntityToCompany(legalEntityResponse, isTargetLegalEntityType);
22864
+ const isNewEntryFlowEnabled = useEnableNewEntryFlow();
22865
+ const dataFromResponse = mapLegalEntityToCompany(legalEntityResponse, isTargetLegalEntityType, isNewEntryFlowEnabled ? accountHolder2 : void 0);
22983
22866
  const {
22984
22867
  getConfiguration: getConfiguration2
22985
22868
  } = useConfigurationApi();
@@ -23035,7 +22918,7 @@ function CompanyDropinComponent({
23035
22918
  });
23036
22919
  onChange == null ? void 0 : onChange(currentState);
23037
22920
  }, [currentState]);
23038
- const isSkippingCompanyStructure = useEnableNewEntryFlow() && organizationTypesToSkipCompanyStructureForm.includes((_b = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _b.type);
22921
+ const isSkippingCompanyStructure = useEnableNewEntryFlow() && organizationTypesToSkipCompanyStructureForm.includes((_b = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _b.type) && accountHolder2 !== "aTrust";
23039
22922
  const forms2 = useMemo(() => {
23040
22923
  const requiredForms = getRequiredForms(companyForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
23041
22924
  const validityAddedForms = addValidityToForms(requiredForms, formValidity, problems);
@@ -23046,8 +22929,7 @@ function CompanyDropinComponent({
23046
22929
  legalEntity,
23047
22930
  dataSubmitted
23048
22931
  }) => {
23049
- if (!isDocumentsRequired$2(forms22))
23050
- return;
22932
+ if (!isDocumentsRequired$2(forms22)) return;
23051
22933
  const formattedDocument = await mapCompanyDocumentToApiDocument(dataSubmitted, legalEntity.id);
23052
22934
  if (formattedDocument) {
23053
22935
  await documentUtils.uploadDocuments(formattedDocument, legalEntity.id);
@@ -23327,8 +23209,7 @@ function useCompanySearch({
23327
23209
  deepSearch
23328
23210
  }) => {
23329
23211
  try {
23330
- if (!deepSearch)
23331
- return;
23212
+ if (!deepSearch) return;
23332
23213
  setStatus("loading");
23333
23214
  setCompaniesList([]);
23334
23215
  const {
@@ -23352,8 +23233,7 @@ function useCompanySearch({
23352
23233
  return setStatus("idle");
23353
23234
  }
23354
23235
  try {
23355
- if (!handleCompanyDeepSearch)
23356
- return;
23236
+ if (!handleCompanyDeepSearch) return;
23357
23237
  setStatus("loading");
23358
23238
  setSelectedCompanyId(void 0);
23359
23239
  const {
@@ -23374,8 +23254,7 @@ function useCompanySearch({
23374
23254
  }, [handleCompanyDeepSearch, country2, legalCompanyName2, limit, stateOrProvince2]);
23375
23255
  const verify2 = useCallback(async (companyTIN, company2) => {
23376
23256
  try {
23377
- if (!handleVerifyTin || !handleGetCompanyDataset || !handleRefreshCompanyDataset)
23378
- return;
23257
+ if (!handleVerifyTin || !handleGetCompanyDataset || !handleRefreshCompanyDataset) return;
23379
23258
  setStatus("loading");
23380
23259
  setSelectedCompanyId(company2.id);
23381
23260
  if (!canVerify || !companyTIN) {
@@ -23541,10 +23420,8 @@ const CompanyLookupResultsHeader = ({
23541
23420
  if (status === "loading") {
23542
23421
  return selectedCompanyId ? i18n.get("companyLookupResultsHeader__verifying") : i18n.get("companyLookupResultsHeader__searching");
23543
23422
  }
23544
- if (numberOfResults === 0 && status === "loaded")
23545
- return i18n.get("companyLookupResultsHeader__noResults");
23546
- if (numberOfResults)
23547
- return i18n.get("companyLookupResultsHeader__results");
23423
+ if (numberOfResults === 0 && status === "loaded") return i18n.get("companyLookupResultsHeader__noResults");
23424
+ if (numberOfResults) return i18n.get("companyLookupResultsHeader__results");
23548
23425
  return i18n.get("companyLookupResultsHeader");
23549
23426
  }, [hasInternalError, status, numberOfResults, i18n, selectedCompanyId]);
23550
23427
  const descriptionText = useMemo(() => {
@@ -23945,8 +23822,7 @@ function TaxInformationField({
23945
23822
  type: countryToTaxInfoTypeMap[country2]
23946
23823
  }];
23947
23824
  const updatedTaxInformation = taxInformation.map((taxInfo) => {
23948
- if (taxInfo.country !== country2)
23949
- return taxInfo;
23825
+ if (taxInfo.country !== country2) return taxInfo;
23950
23826
  return {
23951
23827
  country: country2,
23952
23828
  number: value,
@@ -23973,8 +23849,7 @@ function TaxInformationField({
23973
23849
  type: countryToTaxInfoTypeMap[country2]
23974
23850
  }];
23975
23851
  const updatedTaxInformation = taxInformation.map((taxInfo) => {
23976
- if (taxInfo.country !== country2)
23977
- return taxInfo;
23852
+ if (taxInfo.country !== country2) return taxInfo;
23978
23853
  return {
23979
23854
  country: country2,
23980
23855
  number: value,
@@ -24055,8 +23930,7 @@ const defaultFieldConfig = entriesOf(defaultFieldConfig$7).reduce((fieldConfig,
24055
23930
  errorMessage: (taxInformation) => {
24056
23931
  var _a;
24057
23932
  const taxIdNumber2 = (_a = taxInformation == null ? void 0 : taxInformation.find((taxId2) => country2 === taxId2.country)) == null ? void 0 : _a.number;
24058
- if (!taxIdNumber2)
24059
- return void 0;
23933
+ if (!taxIdNumber2) return void 0;
24060
23934
  return typeof validator.errorMessage === "function" ? validator.errorMessage(taxIdNumber2) : validator.errorMessage;
24061
23935
  }
24062
23936
  }));
@@ -24990,8 +24864,7 @@ const formatDataForSummary = (data, forms2, labels2, i18n) => {
24990
24864
  }, defaultFieldMetadata).label;
24991
24865
  return entriesOf(data).reduce((summaryData, [form, formData]) => {
24992
24866
  var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
24993
- if (!form)
24994
- return summaryData;
24867
+ if (!form) return summaryData;
24995
24868
  switch (form) {
24996
24869
  case "companyBasics":
24997
24870
  return {
@@ -25025,8 +24898,7 @@ const formatDataForSummary = (data, forms2, labels2, i18n) => {
25025
24898
  [form]: formatOtherDetails(formData, i18n, (_f = data.companyBasics) == null ? void 0 : _f.country, labels2)
25026
24899
  };
25027
24900
  case "companyRegistrationDocument":
25028
- if (!isDocumentsRequired$1(forms2))
25029
- return summaryData;
24901
+ if (!isDocumentsRequired$1(forms2)) return summaryData;
25030
24902
  return {
25031
24903
  ...summaryData,
25032
24904
  [form]: {
@@ -25036,8 +24908,7 @@ const formatDataForSummary = (data, forms2, labels2, i18n) => {
25036
24908
  }
25037
24909
  };
25038
24910
  case "companyTaxDocument":
25039
- if (!isDocumentsRequired$1(forms2))
25040
- return summaryData;
24911
+ if (!isDocumentsRequired$1(forms2)) return summaryData;
25041
24912
  return {
25042
24913
  ...summaryData,
25043
24914
  [form]: {
@@ -25280,8 +25151,7 @@ function useCompanySearchTaskSubmit({
25280
25151
  legalEntity,
25281
25152
  currentForms
25282
25153
  }) => {
25283
- if (!isDocumentsRequired$1(currentForms))
25284
- return;
25154
+ if (!isDocumentsRequired$1(currentForms)) return;
25285
25155
  const formattedDocument = await mapCompanySearchDocumentToApiDocument(data, legalEntity.id);
25286
25156
  try {
25287
25157
  if (formattedDocument) {
@@ -25583,8 +25453,7 @@ function CompanySearchDropinComponent({
25583
25453
  var _a2;
25584
25454
  eventEmitter.on("updateLocale", (locale) => setLocale(locale));
25585
25455
  const documentIds = ((_a2 = legalEntityResponse == null ? void 0 : legalEntityResponse.documentDetails) == null ? void 0 : _a2.map((documentReference) => documentReference.id)) || [];
25586
- if (!documentIds.length)
25587
- return;
25456
+ if (!documentIds.length) return;
25588
25457
  documentUtils.fetchDocuments(documentIds, legalEntityResponse.id).then(() => {
25589
25458
  setInitialData({
25590
25459
  ...initialData,
@@ -25743,8 +25612,7 @@ const useLocalStorage = (key, defaultValue, options) => {
25743
25612
  }), [options]);
25744
25613
  const rawValueRef = useRef(null);
25745
25614
  const [value, setValue] = useState(() => {
25746
- if (typeof window === "undefined")
25747
- return defaultValue;
25615
+ if (typeof window === "undefined") return defaultValue;
25748
25616
  try {
25749
25617
  rawValueRef.current = window.localStorage.getItem(key);
25750
25618
  const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
@@ -25755,8 +25623,7 @@ const useLocalStorage = (key, defaultValue, options) => {
25755
25623
  }
25756
25624
  });
25757
25625
  useEffect(() => {
25758
- if (typeof window === "undefined")
25759
- return;
25626
+ if (typeof window === "undefined") return;
25760
25627
  const updateLocalStorage = () => {
25761
25628
  if (value !== void 0) {
25762
25629
  const newValue = serializer(value);
@@ -25786,11 +25653,9 @@ const useLocalStorage = (key, defaultValue, options) => {
25786
25653
  }
25787
25654
  }, [value]);
25788
25655
  useEffect(() => {
25789
- if (!syncData)
25790
- return;
25656
+ if (!syncData) return;
25791
25657
  const handleStorageChange = (event) => {
25792
- if (event.key !== key || event.storageArea !== window.localStorage)
25793
- return;
25658
+ if (event.key !== key || event.storageArea !== window.localStorage) return;
25794
25659
  try {
25795
25660
  if (event.newValue !== rawValueRef.current) {
25796
25661
  rawValueRef.current = event.newValue;
@@ -25800,8 +25665,7 @@ const useLocalStorage = (key, defaultValue, options) => {
25800
25665
  logger$c.error(err);
25801
25666
  }
25802
25667
  };
25803
- if (typeof window === "undefined")
25804
- return;
25668
+ if (typeof window === "undefined") return;
25805
25669
  window.addEventListener("storage", handleStorageChange);
25806
25670
  return () => window.removeEventListener("storage", handleStorageChange);
25807
25671
  }, [key, syncData]);
@@ -25835,11 +25699,9 @@ const useIsEligibleForSingpass = ({
25835
25699
  const {
25836
25700
  isExperimentEnabled
25837
25701
  } = useExperimentsContext();
25838
- if (!isExperimentEnabled("ShowSingPassButtonForCompanies"))
25839
- return false;
25702
+ if (!isExperimentEnabled("ShowSingPassButtonForCompanies")) return false;
25840
25703
  const isSingpassEnabled = Boolean(handleOpenSingpassAuthorizationLink) && getLegalEntityCountry(legalEntity) === CountryCodes.Singapore;
25841
- if (!isSingpassEnabled)
25842
- return false;
25704
+ if (!isSingpassEnabled) return false;
25843
25705
  if (accountHolder2) {
25844
25706
  return accountHolder2 === "theCompanyIWorkFor";
25845
25707
  }
@@ -25882,8 +25744,7 @@ const useExemptSettlor = ({
25882
25744
  setExemptSettlor(exemptSettlorLE);
25883
25745
  }, [handleGetLegalEntity]);
25884
25746
  useEffect(() => {
25885
- if (!(trust2 == null ? void 0 : trust2.trust))
25886
- return;
25747
+ if (!(trust2 == null ? void 0 : trust2.trust)) return;
25887
25748
  updateExemptSettlor(trust2).catch(logger$a.error);
25888
25749
  }, [trust2, updateExemptSettlor]);
25889
25750
  return exemptSettlor;
@@ -25944,8 +25805,7 @@ const saveBlobAsFile = (fileData, filename) => {
25944
25805
  const isNewEntity = Symbol("isNewEntity");
25945
25806
  const splitAtFirstOccurrence = (str, separator) => {
25946
25807
  const firstOccurrence = str.indexOf(separator);
25947
- if (firstOccurrence === -1)
25948
- return [str];
25808
+ if (firstOccurrence === -1) return [str];
25949
25809
  return [str.slice(0, firstOccurrence), str.slice(firstOccurrence + 1)];
25950
25810
  };
25951
25811
  const getTrustMemberOwnerId = (trustMemberId, entityAssociations) => {
@@ -25972,23 +25832,21 @@ const convertEntityAssociationIntoTrustMember = (association2, associations, exe
25972
25832
  name: association2.name
25973
25833
  };
25974
25834
  }
25975
- if (association2.entityType === LegalEntityType.ORGANIZATION)
25976
- return {
25977
- trustMemberType: "company",
25978
- roles: [],
25979
- legalEntityType: LegalEntityType.ORGANIZATION,
25980
- legalEntityId: association2.legalEntityId,
25981
- name: association2.name,
25982
- ownerId: getTrustMemberOwnerId(association2.legalEntityId, associations)
25983
- };
25984
- if (association2.entityType === LegalEntityType.INDIVIDUAL)
25985
- return {
25986
- trustMemberType: "regular",
25987
- roles: [],
25988
- legalEntityType: LegalEntityType.INDIVIDUAL,
25989
- legalEntityId: association2.legalEntityId,
25990
- name: association2.name
25991
- };
25835
+ if (association2.entityType === LegalEntityType.ORGANIZATION) return {
25836
+ trustMemberType: "company",
25837
+ roles: [],
25838
+ legalEntityType: LegalEntityType.ORGANIZATION,
25839
+ legalEntityId: association2.legalEntityId,
25840
+ name: association2.name,
25841
+ ownerId: getTrustMemberOwnerId(association2.legalEntityId, associations)
25842
+ };
25843
+ if (association2.entityType === LegalEntityType.INDIVIDUAL) return {
25844
+ trustMemberType: "regular",
25845
+ roles: [],
25846
+ legalEntityType: LegalEntityType.INDIVIDUAL,
25847
+ legalEntityId: association2.legalEntityId,
25848
+ name: association2.name
25849
+ };
25992
25850
  throw new Error(`Not a valid trust member: ${JSON.stringify(association2)}`);
25993
25851
  };
25994
25852
  const mapEntityAssociationsToTrustMembers = (trustEntityId, entityAssociations, exemptSettlorLE) => {
@@ -26048,14 +25906,13 @@ const mapTrustMemberToEntityAssociations = (trustMember) => {
26048
25906
  if (trustMember.legalEntityId === isNewEntity) {
26049
25907
  throw Error("Cannot map a new trust member, you must create it first");
26050
25908
  }
26051
- if (trustMember.trustMemberType === "exemptSettlor")
26052
- return [{
26053
- legalEntityId: trustMember.legalEntityId,
26054
- entityType: trustMember.legalEntityType,
26055
- type: TrustMemberTypes.SETTLOR,
26056
- settlorExemptionReason: trustMember.settlorExemptionReason,
26057
- name: trustMember.legalEntityType === LegalEntityType.INDIVIDUAL ? `${(_a = trustMember.exemptSettlorName) == null ? void 0 : _a.firstName} ${(_b = trustMember.exemptSettlorName) == null ? void 0 : _b.lastName}` : trustMember.name ?? ""
26058
- }];
25909
+ if (trustMember.trustMemberType === "exemptSettlor") return [{
25910
+ legalEntityId: trustMember.legalEntityId,
25911
+ entityType: trustMember.legalEntityType,
25912
+ type: TrustMemberTypes.SETTLOR,
25913
+ settlorExemptionReason: trustMember.settlorExemptionReason,
25914
+ name: trustMember.legalEntityType === LegalEntityType.INDIVIDUAL ? `${(_a = trustMember.exemptSettlorName) == null ? void 0 : _a.firstName} ${(_b = trustMember.exemptSettlorName) == null ? void 0 : _b.lastName}` : trustMember.name ?? ""
25915
+ }];
26059
25916
  return trustMember.roles.map((role2) => ({
26060
25917
  legalEntityId: trustMember.legalEntityId,
26061
25918
  type: role2
@@ -26436,8 +26293,7 @@ const BusinessTypeSelection = ({
26436
26293
  }, []);
26437
26294
  const handleNextClick = async () => {
26438
26295
  var _a2;
26439
- if (loadingStatus === "loading")
26440
- return;
26296
+ if (loadingStatus === "loading") return;
26441
26297
  triggerValidation();
26442
26298
  if (isValid) {
26443
26299
  if (((_a2 = data.businessType) == null ? void 0 : _a2.id) === "legalArrangement") {
@@ -26487,18 +26343,15 @@ const BusinessTypeSelection = ({
26487
26343
  type: targetLegalEntityType
26488
26344
  };
26489
26345
  await (handleUpdateLegalEntity == null ? void 0 : handleUpdateLegalEntity(updateLegalEntityPayload, legalEntityResponse == null ? void 0 : legalEntityResponse.id));
26490
- if (targetLegalEntityType === LegalEntityType.ORGANIZATION && targetLegalEntityType) {
26491
- await (handleUpdateLegalEntity == null ? void 0 : handleUpdateLegalEntity({
26492
- organization: {
26493
- type: mapLegalArrangementOptionToCompanyTypesValue(targetLegalArrangement)
26494
- }
26495
- }, legalEntityResponse == null ? void 0 : legalEntityResponse.id));
26496
- }
26497
26346
  }
26498
- if (isLegalArrangementChanging && targetLegalArrangement) {
26347
+ if (targetLegalEntityType === LegalEntityType.INDIVIDUAL) {
26348
+ return;
26349
+ }
26350
+ const targetOrganizationType = determineOrganizationTypeToUpdate(defaultLegalArrangementType == null ? void 0 : defaultLegalArrangementType.id, targetLegalArrangement, currentCompanyTypesValue);
26351
+ if (targetOrganizationType !== void 0) {
26499
26352
  await (handleUpdateLegalEntity == null ? void 0 : handleUpdateLegalEntity({
26500
26353
  organization: {
26501
- type: mapLegalArrangementOptionToCompanyTypesValue(targetLegalArrangement)
26354
+ type: targetOrganizationType
26502
26355
  }
26503
26356
  }, legalEntityResponse == null ? void 0 : legalEntityResponse.id));
26504
26357
  }
@@ -27433,12 +27286,9 @@ const useLegalEntityType = ({
27433
27286
  switch (legalEntity.type) {
27434
27287
  case LegalEntityType.INDIVIDUAL:
27435
27288
  case LegalEntityType.ORGANIZATION:
27436
- if (!hasLegalAssociation)
27437
- return legalEntity.type;
27438
- if (isSoleProprietor)
27439
- return LegalEntityType.SOLE_PROPRIETORSHIP;
27440
- if (isTrust)
27441
- return LegalEntityType.TRUST;
27289
+ if (!hasLegalAssociation) return legalEntity.type;
27290
+ if (isSoleProprietor) return LegalEntityType.SOLE_PROPRIETORSHIP;
27291
+ if (isTrust) return LegalEntityType.TRUST;
27442
27292
  break;
27443
27293
  default:
27444
27294
  return void 0;
@@ -27483,12 +27333,9 @@ const useIntroductionScreens = ({
27483
27333
  const isSoleProprietor = legalEntityType === LegalEntityType.SOLE_PROPRIETORSHIP;
27484
27334
  const isTrustScreen = screen === IntroductionScreens.TRUST || screen === IntroductionScreens.TRUST_MEMBER_OVERVIEW;
27485
27335
  const isTrust = legalEntityType === LegalEntityType.TRUST;
27486
- if (isAccountScreen)
27487
- return hasAccountTask;
27488
- if (isSoleProprietorScreen)
27489
- return isSoleProprietor;
27490
- if (isTrustScreen)
27491
- return isTrust;
27336
+ if (isAccountScreen) return hasAccountTask;
27337
+ if (isSoleProprietorScreen) return isSoleProprietor;
27338
+ if (isTrustScreen) return isTrust;
27492
27339
  return tasks.some((task) => screen === task);
27493
27340
  }) : [], [legalEntityType, tasks]);
27494
27341
  return canSeeIntroduction && (introductionScreens == null ? void 0 : introductionScreens.length) > 0 ? [IntroductionScreens.PROLOGUE, ...introductionScreens, IntroductionScreens.EPILOGUE] : void 0;
@@ -28938,8 +28785,7 @@ function IndividualDropinComponent({
28938
28785
  dataSubmitted
28939
28786
  }) => {
28940
28787
  var _a2;
28941
- if (!isDocumentsRequired2(forms22))
28942
- return;
28788
+ if (!isDocumentsRequired2(forms22)) return;
28943
28789
  if ((_a2 = dataSubmitted.idDocument) == null ? void 0 : _a2.instantIdVerificationData) {
28944
28790
  await handleInstantIdVerificationStartCheck(dataSubmitted.idDocument.instantIdVerificationData, legalEntity.id);
28945
28791
  } else {
@@ -29075,20 +28921,17 @@ function IndividualDropinComponent({
29075
28921
  const datasetUtils = datasetUtilities(i18n.locale);
29076
28922
  const formatIdDocument = (idDocument2) => {
29077
28923
  var _a2, _b2;
29078
- if (!idDocument2)
29079
- return void 0;
28924
+ if (!idDocument2) return void 0;
29080
28925
  const documentType2 = (idDocument2 == null ? void 0 : idDocument2.instantIdVerificationData) ? onfidoDocumentTypeMapping.find((document2) => {
29081
28926
  var _a3;
29082
28927
  return ((_a3 = idDocument2.instantIdVerificationData) == null ? void 0 : _a3.document_front.type) === document2.id;
29083
28928
  }) : idDocumentTypeOptions.find(({
29084
28929
  id: id2
29085
28930
  }) => idDocument2.idDocumentType === id2);
29086
- if (!documentType2)
29087
- return void 0;
28931
+ if (!documentType2) return void 0;
29088
28932
  const frontPage2 = (_a2 = idDocument2.idFrontPage) == null ? void 0 : _a2[0];
29089
28933
  const backPage2 = (_b2 = idDocument2.idBackPage) == null ? void 0 : _b2[0];
29090
- if (!frontPage2)
29091
- return void 0;
28934
+ if (!frontPage2) return void 0;
29092
28935
  return {
29093
28936
  documentType: i18n.get(documentType2.name),
29094
28937
  ...backPage2 && documentType2.hasBackPage ? {
@@ -29272,8 +29115,7 @@ const rules$1 = ({
29272
29115
  }) => ({
29273
29116
  whenUsingManualVerification: () => {
29274
29117
  var _a;
29275
- if (!data.payoutVerificationMethod)
29276
- return;
29118
+ if (!data.payoutVerificationMethod) return;
29277
29119
  if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
29278
29120
  return "REQUIRED";
29279
29121
  }
@@ -29833,8 +29675,7 @@ function PciDropinComponent({
29833
29675
  name: `${(_a = legalEntityResponse == null ? void 0 : legalEntityResponse.individual) == null ? void 0 : _a.name.firstName} ${(_b = legalEntityResponse.individual) == null ? void 0 : _b.name.lastName}`
29834
29676
  }];
29835
29677
  const handleSignClick = async () => {
29836
- if (loadingStatus === "loading")
29837
- return;
29678
+ if (loadingStatus === "loading") return;
29838
29679
  userEvents.addEvent("Clicked PCI signing", {
29839
29680
  segmentation: {
29840
29681
  ...baseTrackingPayload
@@ -29966,8 +29807,7 @@ function PciDropinComponent({
29966
29807
  });
29967
29808
  }
29968
29809
  const convertExistingSettlorExemptionReasons = (existingReasons) => {
29969
- if (!existingReasons || !existingReasons.length)
29970
- return ["noneOfTheAbove"];
29810
+ if (!existingReasons || !existingReasons.length) return ["noneOfTheAbove"];
29971
29811
  return existingReasons;
29972
29812
  };
29973
29813
  const convertExistingTrustMember = (trustMember) => {
@@ -30082,8 +29922,7 @@ const getAvailableRolesByTrustMemberTypeAndLegalEntityType = (currentRoles, trus
30082
29922
  return roles.filter((r) => r !== "secondaryTrustee");
30083
29923
  };
30084
29924
  const getAvailableRoles = (currentRoles) => {
30085
- if (!(currentRoles == null ? void 0 : currentRoles.length))
30086
- return Object.values(TrustMemberTypes);
29925
+ if (!(currentRoles == null ? void 0 : currentRoles.length)) return Object.values(TrustMemberTypes);
30087
29926
  return currentRoles.map((role2) => [role2, ...allowedCrossoverRolesMatrix[role2]]).reduce((existingAllowed, allowedForRole) => existingAllowed.filter((role2) => allowedForRole.includes(role2)));
30088
29927
  };
30089
29928
  const trustMemberLegalEntityTypes = [LegalEntityType.INDIVIDUAL, LegalEntityType.ORGANIZATION];
@@ -30420,8 +30259,7 @@ const exemptSettlorForms = {
30420
30259
  summary
30421
30260
  };
30422
30261
  const decideForms = (trustMember) => {
30423
- if (trustMember === "incomplete")
30424
- return regularForms;
30262
+ if (trustMember === "incomplete") return regularForms;
30425
30263
  switch (trustMember.trustMemberType) {
30426
30264
  case "undefinedBeneficiary":
30427
30265
  return undefinedBeneficiaryForms;
@@ -30471,13 +30309,12 @@ const convertDataToTrustMember = (data, existingTrustMember, isOrganizationSettl
30471
30309
  legalEntityId: existingId ?? isNewEntity
30472
30310
  };
30473
30311
  }
30474
- if (data.role.includes("undefinedBeneficiary"))
30475
- return {
30476
- trustMemberType: "undefinedBeneficiary",
30477
- roles: [TrustMemberTypes.UNDEFINED_BENEFICIARY],
30478
- description: data.descriptionUndefinedBeneficiary ?? "",
30479
- reference: existingId ?? isNewEntity
30480
- };
30312
+ if (data.role.includes("undefinedBeneficiary")) return {
30313
+ trustMemberType: "undefinedBeneficiary",
30314
+ roles: [TrustMemberTypes.UNDEFINED_BENEFICIARY],
30315
+ description: data.descriptionUndefinedBeneficiary ?? "",
30316
+ reference: existingId ?? isNewEntity
30317
+ };
30481
30318
  if (data.entityType === LegalEntityType.ORGANIZATION) {
30482
30319
  return {
30483
30320
  trustMemberType: "company",
@@ -30488,14 +30325,13 @@ const convertDataToTrustMember = (data, existingTrustMember, isOrganizationSettl
30488
30325
  country: data.country
30489
30326
  };
30490
30327
  }
30491
- if (data.entityType === LegalEntityType.INDIVIDUAL)
30492
- return {
30493
- trustMemberType: "regular",
30494
- roles: data.role,
30495
- legalEntityType: LegalEntityType.INDIVIDUAL,
30496
- legalEntityId: existingId ?? isNewEntity,
30497
- name: ""
30498
- };
30328
+ if (data.entityType === LegalEntityType.INDIVIDUAL) return {
30329
+ trustMemberType: "regular",
30330
+ roles: data.role,
30331
+ legalEntityType: LegalEntityType.INDIVIDUAL,
30332
+ legalEntityId: existingId ?? isNewEntity,
30333
+ name: ""
30334
+ };
30499
30335
  }
30500
30336
  return "incomplete";
30501
30337
  };
@@ -30555,8 +30391,7 @@ function RoleAndTypeDropinComponent({
30555
30391
  setTrustMember(convertDataToTrustMember(data, existingTrustMember, isOrganizationSettlorWithExemptionEnabled));
30556
30392
  };
30557
30393
  const saveRolesAndNavigate = async () => {
30558
- if (trustMember === "incomplete")
30559
- return;
30394
+ if (trustMember === "incomplete") return;
30560
30395
  if (hasRolesChanged(trustMember.roles, existingTrustMember == null ? void 0 : existingTrustMember.roles)) {
30561
30396
  addOrUpdateTrustMember(trustMember);
30562
30397
  }
@@ -30579,8 +30414,7 @@ function RoleAndTypeDropinComponent({
30579
30414
  navigateToFullDropinFor(trustMember);
30580
30415
  return;
30581
30416
  }
30582
- if (targetForm.formId === summaryStep.formId)
30583
- return;
30417
+ if (targetForm.formId === summaryStep.formId) return;
30584
30418
  }
30585
30419
  setActiveForm(targetForm);
30586
30420
  };
@@ -30654,8 +30488,7 @@ const useServiceAgreement = ({
30654
30488
  }, [language]);
30655
30489
  useEffect(() => {
30656
30490
  const requestAcceptedServiceAgreement = async () => {
30657
- if (!handleViewAcceptedTermsOfServiceDocument || !acceptanceId)
30658
- return;
30491
+ if (!handleViewAcceptedTermsOfServiceDocument || !acceptanceId) return;
30659
30492
  setLoading("loading");
30660
30493
  const {
30661
30494
  id: id2,
@@ -30671,8 +30504,7 @@ const useServiceAgreement = ({
30671
30504
  }, [acceptanceId, handleViewAcceptedTermsOfServiceDocument]);
30672
30505
  useEffect(() => {
30673
30506
  const requestServiceAgreement = async () => {
30674
- if (acceptanceId)
30675
- return;
30507
+ if (acceptanceId) return;
30676
30508
  setLoading("loading");
30677
30509
  try {
30678
30510
  const {
@@ -30808,8 +30640,7 @@ function ServiceAgreementDropinComponent({
30808
30640
  }
30809
30641
  });
30810
30642
  triggerValidation();
30811
- if (loadingStatus === "loading" || !serviceAgreement || !data.signer)
30812
- return;
30643
+ if (loadingStatus === "loading" || !serviceAgreement || !data.signer) return;
30813
30644
  if (isValid) {
30814
30645
  try {
30815
30646
  setLoadingStatus("loading");
@@ -30866,8 +30697,7 @@ function ServiceAgreementDropinComponent({
30866
30697
  });
30867
30698
  };
30868
30699
  useEffect(() => {
30869
- if (!serviceAgreementAcceptanceInfos.length)
30870
- return;
30700
+ if (!serviceAgreementAcceptanceInfos.length) return;
30871
30701
  gotoForm(serviceAgreementAcceptanceInfos.length - 1);
30872
30702
  }, [serviceAgreementAcceptanceInfos]);
30873
30703
  useEffect(() => {
@@ -30886,8 +30716,7 @@ function ServiceAgreementDropinComponent({
30886
30716
  };
30887
30717
  const onDownloadAcceptedTermsOfServiceDocument = async () => {
30888
30718
  try {
30889
- if (!canDownload)
30890
- return;
30719
+ if (!canDownload) return;
30891
30720
  const response = await handleDownloadAcceptedTermsOfServiceDocument(legalEntityResponse.id, activeForm.acceptanceId);
30892
30721
  await downloadFile(response.document, `${i18n.get(activeForm.formName)}.pdf`);
30893
30722
  } catch (e) {
@@ -31655,8 +31484,7 @@ const useNavigation = ({
31655
31484
  }
31656
31485
  }, [onNavigate]);
31657
31486
  const navigateBack = useCallback((stepCount = 1) => {
31658
- if (taskHistory.length <= 1)
31659
- return;
31487
+ if (taskHistory.length <= 1) return;
31660
31488
  const prevTask = taskHistory[taskHistory.length - (stepCount + 1)];
31661
31489
  if (prevTask === "default") {
31662
31490
  throw Error("Cannot navigate back to 'default' task");
@@ -31696,17 +31524,17 @@ const getDefaultTask = ({
31696
31524
  showIntroduction,
31697
31525
  shouldShowSingpassSelection
31698
31526
  }) => {
31527
+ const hasLegalEntityProgressedBeyondEntitySelection = hasProgressedBeyondEntitySelection(legalEntity);
31528
+ if (isNewEntryFlowEnabled && !accountHolder2 && !hasLegalEntityProgressedBeyondEntitySelection) return TaskTypes.BUSINESS_TYPE_SELECTION;
31529
+ if (showIntroduction) return TaskTypes.INTRODUCTION;
31530
+ if (shouldShowSingpassSelection) return TaskTypes.SINGPASS_SELECTION;
31531
+ return TaskTypes.TASKS_OVERVIEW;
31532
+ };
31533
+ const hasProgressedBeyondEntitySelection = (legalEntity) => {
31699
31534
  var _a, _b;
31700
31535
  const hasOwnEntityAssocation = (_a = legalEntity.entityAssociations) == null ? void 0 : _a.some((ea) => ea.associatorId === legalEntity.id);
31701
31536
  const hasOrganizationType = (_b = legalEntity.organization) == null ? void 0 : _b.type;
31702
- const hasProgressedBeyondEntitySelection = hasOwnEntityAssocation || !!hasOrganizationType;
31703
- if (isNewEntryFlowEnabled && !accountHolder2 && !hasProgressedBeyondEntitySelection)
31704
- return TaskTypes.BUSINESS_TYPE_SELECTION;
31705
- if (showIntroduction)
31706
- return TaskTypes.INTRODUCTION;
31707
- if (shouldShowSingpassSelection)
31708
- return TaskTypes.SINGPASS_SELECTION;
31709
- return TaskTypes.TASKS_OVERVIEW;
31537
+ return hasOwnEntityAssocation || !!hasOrganizationType;
31710
31538
  };
31711
31539
  const PAGES_WITH_POLLING = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
31712
31540
  const POLLING_INTERVAL = 3e3;
@@ -31847,8 +31675,7 @@ function DropinComposerComponent({
31847
31675
  }
31848
31676
  }, [additionalSalesChannels, i18n, rootLegalEntity.id, args.handleGetPciTemplate]);
31849
31677
  useEffect(() => {
31850
- if (!tasks.includes(TaskTypes.PCI_DSS))
31851
- return;
31678
+ if (!tasks.includes(TaskTypes.PCI_DSS)) return;
31852
31679
  getPciTemplate().catch(logger$8.error);
31853
31680
  }, [getPciTemplate, tasks]);
31854
31681
  const addFetchedAcceptedByName = async (acceptanceInfo) => {
@@ -32516,7 +32343,8 @@ function DropinComposerComponent({
32516
32343
  handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
32517
32344
  handleFindAddress: args == null ? void 0 : args.handleFindAddress,
32518
32345
  onTypeSwitch: navigateToTypeSwitcher,
32519
- isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION
32346
+ isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION,
32347
+ accountHolder: accountHolder2
32520
32348
  });
32521
32349
  case TaskTypes.COMPANY_SEARCH:
32522
32350
  return jsx(CompanySearchDropinComponent, {
@@ -32573,7 +32401,8 @@ function DropinComposerComponent({
32573
32401
  homeButtonLabel: i18n.get("saveAndGoToOverview"),
32574
32402
  associationDetail: trustMember,
32575
32403
  handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
32576
- handleFindAddress: args == null ? void 0 : args.handleFindAddress
32404
+ handleFindAddress: args == null ? void 0 : args.handleFindAddress,
32405
+ accountHolder: accountHolder2
32577
32406
  });
32578
32407
  case TaskTypes.PAYOUT:
32579
32408
  case TaskTypes.PAYIN:
@@ -33336,11 +33165,9 @@ function ViewVerificationStatusComponent({
33336
33165
  const [onboardingStatus, setOnboardingStatus] = useState();
33337
33166
  const [alertContent, setAlertContent] = useState();
33338
33167
  const content = useMemo(() => {
33339
- if (!onboardingStatus)
33340
- return;
33168
+ if (!onboardingStatus) return;
33341
33169
  const statusContent = getContentByStatus(onboardingStatus);
33342
- if (statusContent)
33343
- return statusContent;
33170
+ if (statusContent) return statusContent;
33344
33171
  logger$5.error(`there is no content for status "${onboardingStatus}"`);
33345
33172
  }, [onboardingStatus]);
33346
33173
  const handleError = ({
@@ -33594,8 +33421,7 @@ const buildSpriteDOMFromResponse = (responseData) => {
33594
33421
  return iconContainer;
33595
33422
  };
33596
33423
  const loadDocumentGuidance = async (loadingContext) => {
33597
- if (isDocumentGuidanceLoaded)
33598
- return;
33424
+ if (isDocumentGuidanceLoaded) return;
33599
33425
  isDocumentGuidanceLoaded = true;
33600
33426
  const responseData = await http({
33601
33427
  loadingContext,
@@ -33877,7 +33703,7 @@ const ConfigurationApiProvider = ({
33877
33703
  isEmbeddedDropin,
33878
33704
  loadingContext
33879
33705
  } = authContext;
33880
- const sdkVersion = "2.41.1";
33706
+ const sdkVersion = "2.41.3";
33881
33707
  useAnalytics({
33882
33708
  onUserEvent,
33883
33709
  legalEntityId: rootLegalEntityId,
@@ -33980,12 +33806,10 @@ const useTranslations = ({
33980
33806
  getDataset: getDataset2
33981
33807
  } = useConfigurationApi();
33982
33808
  useEffect(() => {
33983
- if (!allowedLocales)
33984
- return;
33809
+ if (!allowedLocales) return;
33985
33810
  const isLocaleAllowed = allowedLocales.includes(locale);
33986
33811
  const localeToUse = isLocaleAllowed ? locale : FALLBACK_LOCALE;
33987
- if (loaded.locale === localeToUse)
33988
- return;
33812
+ if (loaded.locale === localeToUse) return;
33989
33813
  if (!isLocaleAllowed) {
33990
33814
  logger.error(`
33991
33815
  "${locale}" isn't a supported locale. Please use one of the following:
@@ -34036,6 +33860,13 @@ const I18nProvider = ({
34036
33860
  children
34037
33861
  });
34038
33862
  };
33863
+ const QueryClient = new QueryClient$1();
33864
+ const QueryClientProvider = ({
33865
+ children
33866
+ }) => jsx(QueryClientProvider$1, {
33867
+ client: QueryClient,
33868
+ children
33869
+ });
34039
33870
  const settingsDefaults = {
34040
33871
  acceptedCountries: void 0,
34041
33872
  allowBankAccountFormatSelection: false,
@@ -34073,8 +33904,7 @@ function SettingsProvider({
34073
33904
  }
34074
33905
  function removeObjectPropsWithEmptyValues(obj) {
34075
33906
  keysOf(obj).forEach((key) => {
34076
- if (obj[key] === null || isEmpty(obj[key]))
34077
- delete obj[key];
33907
+ if (obj[key] === null || isEmpty(obj[key])) delete obj[key];
34078
33908
  });
34079
33909
  return obj;
34080
33910
  }
@@ -34354,10 +34184,8 @@ class BaseElement {
34354
34184
  }
34355
34185
  }
34356
34186
  const getRootLegalEntityId = (componentProps) => {
34357
- if ("legalEntityId" in componentProps)
34358
- return componentProps.legalEntityId;
34359
- if ("legalEntityResponse" in componentProps)
34360
- return componentProps.legalEntityResponse.id;
34187
+ if ("legalEntityId" in componentProps) return componentProps.legalEntityId;
34188
+ if ("legalEntityResponse" in componentProps) return componentProps.legalEntityResponse.id;
34361
34189
  throw new Error("You must provide either `legalEntityId` or `legalEntityResponse`");
34362
34190
  };
34363
34191
  class UIElement extends BaseElement {
@@ -34390,9 +34218,11 @@ class UIElement extends BaseElement {
34390
34218
  children: jsx(AutoResizer, {
34391
34219
  children: jsx(ToastContextProvider, {
34392
34220
  children: jsx(StateProvider, {
34393
- children: jsx(Component, {
34394
- ...this.props.componentProps,
34395
- eventEmitter: this.eventEmitter
34221
+ children: jsx(QueryClientProvider, {
34222
+ children: jsx(Component, {
34223
+ ...this.props.componentProps,
34224
+ eventEmitter: this.eventEmitter
34225
+ })
34396
34226
  })
34397
34227
  })
34398
34228
  })
@@ -35248,8 +35078,7 @@ class Core {
35248
35078
  };
35249
35079
  validateCoreOptions(newOptions);
35250
35080
  newOptions.loadingContext = normalizeEnvironment(newOptions.environment);
35251
- if (!newOptions.locale)
35252
- newOptions.locale = FALLBACK_LOCALE;
35081
+ if (!newOptions.locale) newOptions.locale = FALLBACK_LOCALE;
35253
35082
  return newOptions;
35254
35083
  };
35255
35084
  this.initializeSession = () => {