@adyen/kyc-components 3.15.1 → 3.15.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 +387 -560
  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);
@@ -2629,21 +2630,17 @@ const matchLocale = (locale, supportedLocales) => supportedLocales.find((supLoc)
2629
2630
  function formatLocale(localeParam) {
2630
2631
  const locale = localeParam.replace("_", "-");
2631
2632
  const format = /([a-z]{2})(-)([A-Z]{2})/;
2632
- if (format.test(locale))
2633
- return locale;
2633
+ if (format.test(locale)) return locale;
2634
2634
  const [languageCode, countryCode] = locale.split("-");
2635
- if (!languageCode || !countryCode)
2636
- return null;
2635
+ if (!languageCode || !countryCode) return null;
2637
2636
  const fullLocale = [languageCode.toLowerCase(), countryCode.toUpperCase()].join("-");
2638
2637
  return fullLocale.length === 5 ? fullLocale : null;
2639
2638
  }
2640
2639
  function parseLocale(locale, supportedLocales = []) {
2641
- if (!locale || locale.length < 1 || locale.length > 5)
2642
- return FALLBACK_LOCALE;
2640
+ if (!locale || locale.length < 1 || locale.length > 5) return FALLBACK_LOCALE;
2643
2641
  const formattedLocale = formatLocale(locale);
2644
2642
  const hasMatch = Boolean(formattedLocale && supportedLocales.includes(formattedLocale));
2645
- if (hasMatch)
2646
- return formattedLocale;
2643
+ if (hasMatch) return formattedLocale;
2647
2644
  return matchLocale(formattedLocale || locale, supportedLocales);
2648
2645
  }
2649
2646
  const formatCustomTranslations = (supportedLocales, customTranslations = {}) => Object.keys(customTranslations).reduce((acc, cur) => {
@@ -3003,7 +3000,7 @@ const mergeFieldMetadataIntoProps = (fieldName, metadata, otherProps) => {
3003
3000
  const MAX_LENGTH = 30;
3004
3001
  const getMaxLengthByFieldAndCountry = (formattingRules, field, country2, ignoreIfFormatterExists) => {
3005
3002
  var _a, _b, _c, _d;
3006
- if (ignoreIfFormatterExists && ((_b = (_a = formattingRules[country2]) == null ? void 0 : _a[field]) == null ? void 0 : _b.formatter)) {
3003
+ if ((_b = (_a = formattingRules[country2]) == null ? void 0 : _a[field]) == null ? void 0 : _b.formatter) {
3007
3004
  return null;
3008
3005
  }
3009
3006
  const maxLength = (_d = (_c = formattingRules[country2]) == null ? void 0 : _c[field]) == null ? void 0 : _d.maxlength;
@@ -3034,8 +3031,7 @@ const createLogger = (namespace) => {
3034
3031
  const methods = {};
3035
3032
  consoleMethodsPrefixable.forEach((method) => {
3036
3033
  methods[method] = (arg1, ...args) => {
3037
- if (!console[method] || suppressed)
3038
- return;
3034
+ if (!console[method] || suppressed) return;
3039
3035
  if (!namespace) {
3040
3036
  console[method](arg1, ...args);
3041
3037
  } else if (stringSubstitutionRegex.test(arg1)) {
@@ -3048,45 +3044,45 @@ const createLogger = (namespace) => {
3048
3044
  return methods;
3049
3045
  };
3050
3046
  const icons = {
3051
- "arrow-left": lazy(() => import("./arrow-left-CCxYxfCP.js")),
3052
- "arrow-right": lazy(() => import("./arrow-right-DF4Qe-8E.js")),
3053
- bin: lazy(() => import("./bin-CGwewvcn.js")),
3054
- check: lazy(() => import("./check-CeSLN4_9.js")),
3055
- checkmark: lazy(() => import("./checkmark-DEh9MPYR.js")),
3056
- "checkmark-small": lazy(() => import("./checkmark-small-D_9HLctx.js")),
3057
- "chevron-down": lazy(() => import("./chevron-down-BzENwYSf.js")),
3058
- "chevron-right": lazy(() => import("./chevron-right-DczMHcvL.js")),
3059
- "chevron-up": lazy(() => import("./chevron-up-BLtnROd5.js")),
3060
- company: lazy(() => import("./company-D5_F_6SW.js")),
3061
- "company-2": lazy(() => import("./company-2-JG34IScE.js")),
3062
- contract: lazy(() => import("./contract-C6wDy9zU.js")),
3063
- "controlling-person": lazy(() => import("./controlling-person-C4KoSyi2.js")),
3064
- cross: lazy(() => import("./cross-BadGfrgB.js")),
3065
- "decision-maker": lazy(() => import("./decision-maker-Cef3-OzY.js")),
3066
- document: lazy(() => import("./document-Cg4kZHpA.js")),
3067
- download: lazy(() => import("./download-DGC5_Bxe.js")),
3068
- edit: lazy(() => import("./edit--fDhojib.js")),
3069
- "field-error": lazy(() => import("./field-error-WElEN1mN.js")),
3070
- "info-circle": lazy(() => import("./info-circle-DkHN1ugA.js")),
3071
- "light-bulb": lazy(() => import("./light-bulb-DEUhbRWP.js")),
3072
- location: lazy(() => import("./location-B1Til-7Q.js")),
3073
- "more-horiz": lazy(() => import("./more-horiz-BieZKfy3.js")),
3074
- "new-document": lazy(() => import("./new-document-BEAJnXCG.js")),
3075
- owners: lazy(() => import("./owners-D1pksb86.js")),
3076
- payout: lazy(() => import("./payout-BFiI--HY.js")),
3077
- pci: lazy(() => import("./pci-DMQLRoAn.js")),
3078
- plus: lazy(() => import("./plus-DAnbeoyS.js")),
3079
- remove: lazy(() => import("./remove-CEmd9YX7.js")),
3080
- review: lazy(() => import("./review-CeQeKHXH.js")),
3081
- search: lazy(() => import("./search-hf3HRVbu.js")),
3082
- signatory: lazy(() => import("./signatory-BVoLPYPu.js")),
3083
- store: lazy(() => import("./store-D2z639xh.js")),
3084
- trust: lazy(() => import("./trust-CpcaQaV7.js")),
3085
- user: lazy(() => import("./user-D6swzlYs.js")),
3086
- "user-business": lazy(() => import("./user-business-CwS5j1qX.js")),
3087
- "users-3": lazy(() => import("./users-3-BdjQ9rEA.js")),
3088
- warning: lazy(() => import("./warning-99uFf1WU.js")),
3089
- wrong: lazy(() => import("./wrong-1wvh7nZe.js"))
3047
+ "arrow-left": lazy(() => import("./arrow-left-CwJQyOFz.js")),
3048
+ "arrow-right": lazy(() => import("./arrow-right-Cs_AKUOH.js")),
3049
+ bin: lazy(() => import("./bin-8yaAerXc.js")),
3050
+ check: lazy(() => import("./check-_cOIMziL.js")),
3051
+ checkmark: lazy(() => import("./checkmark-CZpv8i5a.js")),
3052
+ "checkmark-small": lazy(() => import("./checkmark-small-C4TPve-W.js")),
3053
+ "chevron-down": lazy(() => import("./chevron-down-CwS2tE_6.js")),
3054
+ "chevron-right": lazy(() => import("./chevron-right-B8cQLres.js")),
3055
+ "chevron-up": lazy(() => import("./chevron-up-DccG0tVR.js")),
3056
+ company: lazy(() => import("./company-BKO80hWm.js")),
3057
+ "company-2": lazy(() => import("./company-2-Cof0usfn.js")),
3058
+ contract: lazy(() => import("./contract-DrX5y2Qf.js")),
3059
+ "controlling-person": lazy(() => import("./controlling-person-B_dn0b9H.js")),
3060
+ cross: lazy(() => import("./cross-aFMJCrLf.js")),
3061
+ "decision-maker": lazy(() => import("./decision-maker-28_rW1ah.js")),
3062
+ document: lazy(() => import("./document-Bn_3PIDG.js")),
3063
+ download: lazy(() => import("./download-DgAZobJV.js")),
3064
+ edit: lazy(() => import("./edit-Dg19Ah77.js")),
3065
+ "field-error": lazy(() => import("./field-error-DkFiF_Cv.js")),
3066
+ "info-circle": lazy(() => import("./info-circle-CXFfd_nO.js")),
3067
+ "light-bulb": lazy(() => import("./light-bulb-CQ29JPA7.js")),
3068
+ location: lazy(() => import("./location-DmmjAv9A.js")),
3069
+ "more-horiz": lazy(() => import("./more-horiz-dyZQKaOn.js")),
3070
+ "new-document": lazy(() => import("./new-document-CeV8zHP8.js")),
3071
+ owners: lazy(() => import("./owners-C1dyQqRO.js")),
3072
+ payout: lazy(() => import("./payout-B-c43MDS.js")),
3073
+ pci: lazy(() => import("./pci-CVqIvwR-.js")),
3074
+ plus: lazy(() => import("./plus-BUH0nzS_.js")),
3075
+ remove: lazy(() => import("./remove-Bor5X8Xu.js")),
3076
+ review: lazy(() => import("./review-DcoDSRJT.js")),
3077
+ search: lazy(() => import("./search-SGLIdnsr.js")),
3078
+ signatory: lazy(() => import("./signatory-BMaWV_18.js")),
3079
+ store: lazy(() => import("./store-N4c2LHJ_.js")),
3080
+ trust: lazy(() => import("./trust-BcVDhtGL.js")),
3081
+ user: lazy(() => import("./user-C8STPF6-.js")),
3082
+ "user-business": lazy(() => import("./user-business-Dcvcw8gB.js")),
3083
+ "users-3": lazy(() => import("./users-3-D3QDBEk-.js")),
3084
+ warning: lazy(() => import("./warning-Dxxpni4H.js")),
3085
+ wrong: lazy(() => import("./wrong-DNwa4zZR.js"))
3090
3086
  };
3091
3087
  const logger$x = createLogger("Icon");
3092
3088
  const Icon = ({
@@ -3226,8 +3222,7 @@ const Alert = ({
3226
3222
  i18n
3227
3223
  } = useI18nContext();
3228
3224
  const [isClosed, setIsClosed] = useState(false);
3229
- if (isClosed)
3230
- return null;
3225
+ if (isClosed) return null;
3231
3226
  const closeAlert = () => setIsClosed(true);
3232
3227
  const classNames = cx("adl-alert", className, {
3233
3228
  "adl-alert--basic": type === AlertTypes.BASIC,
@@ -3339,8 +3334,7 @@ const Link = ({
3339
3334
  iconLeft = false,
3340
3335
  onClick
3341
3336
  }) => {
3342
- if (!isValidLink(href))
3343
- return null;
3337
+ if (!isValidLink(href)) return null;
3344
3338
  const target = external ? "_blank" : "_self";
3345
3339
  const rel = external ? "external noopener noreferrer" : void 0;
3346
3340
  const showIcon = icon || external;
@@ -3618,8 +3612,7 @@ const useAllowedCountries = () => {
3618
3612
  } = useConfigurationApi();
3619
3613
  const [allowedCountries, setAllowedCountries] = useState(acceptedCountries);
3620
3614
  useEffect(() => {
3621
- if (acceptedCountries !== void 0)
3622
- return;
3615
+ if (acceptedCountries !== void 0) return;
3623
3616
  getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$v.error);
3624
3617
  }, [acceptedCountries]);
3625
3618
  return allowedCountries;
@@ -3750,8 +3743,7 @@ function reducer({
3750
3743
  const validationSchema = selectedSchema || state2.schema;
3751
3744
  switch (type) {
3752
3745
  case "setData": {
3753
- if (!key)
3754
- return state2;
3746
+ if (!key) return state2;
3755
3747
  return {
3756
3748
  ...state2,
3757
3749
  data: {
@@ -3761,8 +3753,7 @@ function reducer({
3761
3753
  };
3762
3754
  }
3763
3755
  case "setValid": {
3764
- if (!key)
3765
- return state2;
3756
+ if (!key) return state2;
3766
3757
  return {
3767
3758
  ...state2,
3768
3759
  valid: {
@@ -3772,8 +3763,7 @@ function reducer({
3772
3763
  };
3773
3764
  }
3774
3765
  case "setErrors": {
3775
- if (!key)
3776
- return state2;
3766
+ if (!key) return state2;
3777
3767
  return {
3778
3768
  ...state2,
3779
3769
  errors: {
@@ -3799,8 +3789,7 @@ function reducer({
3799
3789
  }, state2);
3800
3790
  }
3801
3791
  case "setSchema": {
3802
- if (!schema)
3803
- return state2;
3792
+ if (!schema) return state2;
3804
3793
  const defaultState = init({
3805
3794
  schema,
3806
3795
  defaultData,
@@ -3835,8 +3824,7 @@ function reducer({
3835
3824
  };
3836
3825
  }
3837
3826
  case "updateField": {
3838
- if (!key || !mode)
3839
- return state2;
3827
+ if (!key || !mode) return state2;
3840
3828
  const [formattedValue, validation] = processField({
3841
3829
  key,
3842
3830
  value,
@@ -3964,11 +3952,9 @@ const useAsyncValidator = (asyncRules) => {
3964
3952
  const [asyncValidationResults, setAsyncValidationResults] = useState({});
3965
3953
  const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
3966
3954
  const triggerAsyncValidation = useCallback((field, formState, mode) => {
3967
- if (!asyncRules)
3968
- return clearAsyncValidationResults();
3955
+ if (!asyncRules) return clearAsyncValidationResults();
3969
3956
  const rule = asyncRules[field];
3970
- if (!rule || !rule.modes.includes(mode))
3971
- return clearAsyncValidationResults();
3957
+ if (!rule || !rule.modes.includes(mode)) return clearAsyncValidationResults();
3972
3958
  const value = formState.data[field];
3973
3959
  return rule.asyncValidate(formState.data[field], {
3974
3960
  state: formState
@@ -4021,8 +4007,7 @@ const useStaticValidator = (rules2) => {
4021
4007
  };
4022
4008
  };
4023
4009
  const mergeStaticAndAsyncErrorsState = (staticValidationErrors, asyncValidationErrors, schema) => {
4024
- if (!schema.length)
4025
- return staticValidationErrors;
4010
+ if (!schema.length) return staticValidationErrors;
4026
4011
  return schema.reduce((acc, field) => {
4027
4012
  var _a;
4028
4013
  return {
@@ -4076,8 +4061,7 @@ function useForm({
4076
4061
  return (_a = state2.schema) == null ? void 0 : _a.every((key) => state2.valid[key]);
4077
4062
  }, [state2.schema, state2.valid]);
4078
4063
  const getTargetValue = useCallback((key, e) => {
4079
- if (!(e == null ? void 0 : e.target))
4080
- return e;
4064
+ if (!(e == null ? void 0 : e.target)) return e;
4081
4065
  if (e.target.type === "checkbox") {
4082
4066
  return !state2.data[key];
4083
4067
  }
@@ -4173,8 +4157,7 @@ function useDataset(datasetIdentifier2, skip) {
4173
4157
  const [dataset, setDataset] = useState([]);
4174
4158
  const [loaded, setLoaded] = useState(false);
4175
4159
  useEffect(() => {
4176
- if (skip)
4177
- return;
4160
+ if (skip) return;
4178
4161
  getDataset2(datasetIdentifier2, i18n.locale).then((response) => {
4179
4162
  const result = response && response.length ? response : [];
4180
4163
  setDataset(result);
@@ -4337,15 +4320,12 @@ const Field = ({
4337
4320
  isValid: !!isValid,
4338
4321
  onBlurHandler: (e) => {
4339
4322
  setIsFocused(false);
4340
- if (onBlur)
4341
- onBlur(e);
4342
- if (onFieldBlur)
4343
- onFieldBlur(e);
4323
+ if (onBlur) onBlur(e);
4324
+ if (onFieldBlur) onFieldBlur(e);
4344
4325
  },
4345
4326
  onFocusHandler: (e) => {
4346
4327
  setIsFocused(true);
4347
- if (onFocus)
4348
- onFocus(e);
4328
+ if (onFocus) onFocus(e);
4349
4329
  },
4350
4330
  uniqueId
4351
4331
  }), helper && helperPosition === "below" && jsx("span", {
@@ -4382,13 +4362,11 @@ const Field = ({
4382
4362
  });
4383
4363
  };
4384
4364
  const getScrollParent = (node) => {
4385
- if (!node)
4386
- return null;
4365
+ if (!node) return null;
4387
4366
  const isElement = node instanceof HTMLElement;
4388
4367
  const overflowY = isElement && window.getComputedStyle(node).overflowY;
4389
4368
  const isScrollable = overflowY !== "visible" && overflowY !== "hidden";
4390
- if (isElement && isScrollable)
4391
- return node;
4369
+ if (isElement && isScrollable) return node;
4392
4370
  return getScrollParent(node.parentNode) ?? document.body;
4393
4371
  };
4394
4372
  function uuidv4() {
@@ -4438,11 +4416,10 @@ function SelectButtonElement({
4438
4416
  isSearch,
4439
4417
  ...props
4440
4418
  }) {
4441
- if (filterable || isMulti || isSearch)
4442
- return jsx("div", {
4443
- ...props,
4444
- ref: toggleButtonRef
4445
- });
4419
+ if (filterable || isMulti || isSearch) return jsx("div", {
4420
+ ...props,
4421
+ ref: toggleButtonRef
4422
+ });
4446
4423
  return jsx("button", {
4447
4424
  ...props,
4448
4425
  ref: toggleButtonRef,
@@ -4634,13 +4611,11 @@ const SelectListItem = ({
4634
4611
  "data-disabled": !!item.disabled,
4635
4612
  "data-value": item.id,
4636
4613
  onClick: () => {
4637
- if (item.disabled)
4638
- return;
4614
+ if (item.disabled) return;
4639
4615
  onSelect(!selected);
4640
4616
  },
4641
4617
  onKeyDown: (e) => {
4642
- if (item.disabled)
4643
- return;
4618
+ if (item.disabled) return;
4644
4619
  onKeyDown(e);
4645
4620
  },
4646
4621
  role: "option",
@@ -4772,8 +4747,7 @@ const Select = ({
4772
4747
  const closeList = () => {
4773
4748
  setTextFilter(null);
4774
4749
  setIsShowList(false);
4775
- if (toggleButtonRef.current)
4776
- toggleButtonRef.current.focus();
4750
+ if (toggleButtonRef.current) toggleButtonRef.current.focus();
4777
4751
  };
4778
4752
  const showList = () => {
4779
4753
  let sp = scrollParent;
@@ -4800,8 +4774,7 @@ const Select = ({
4800
4774
  setIsShowList(false);
4801
4775
  };
4802
4776
  const handleSelect = (selectedItem) => {
4803
- if (readonly)
4804
- return;
4777
+ if (readonly) return;
4805
4778
  if (isMulti) {
4806
4779
  const isAlreadySelected = active.find((item) => item.id === selectedItem.id);
4807
4780
  const newActiveItems = isAlreadySelected ? [...active.filter((i) => i.id !== selectedItem.id).map((i) => i.id)] : [...active.map((i) => i.id), selectedItem.id];
@@ -4864,8 +4837,7 @@ const Select = ({
4864
4837
  break;
4865
4838
  case KEYBOARD_KEYS.arrowDown:
4866
4839
  e.preventDefault();
4867
- if (target.nextElementSibling)
4868
- target.nextElementSibling.focus();
4840
+ if (target.nextElementSibling) target.nextElementSibling.focus();
4869
4841
  break;
4870
4842
  case KEYBOARD_KEYS.arrowUp:
4871
4843
  e.preventDefault();
@@ -5664,8 +5636,7 @@ const tryShift = (matchedTokens, remainingTokens, fromIndex, shiftDistance) => {
5664
5636
  }
5665
5637
  return ((_a = token.allow) == null ? void 0 : _a.test(token.potentialValue)) ?? true;
5666
5638
  });
5667
- if (!allValid)
5668
- return "notPossible";
5639
+ if (!allValid) return "notPossible";
5669
5640
  let matchedUpTo = 0;
5670
5641
  for (let i = 0; i < normalizedTokens.length; i += 1) {
5671
5642
  const token = normalizedInputTokens.find((t) => t.originalIndex === i) ?? normalizedTokens[i];
@@ -5700,8 +5671,7 @@ const getAvailableInputTokens = (tokens) => {
5700
5671
  ...token,
5701
5672
  offset: tokens.indexOf(token)
5702
5673
  });
5703
- if (token.type !== "input" || !token.optional)
5704
- break;
5674
+ if (token.type !== "input" || !token.optional) break;
5705
5675
  }
5706
5676
  return availableTokens;
5707
5677
  };
@@ -5710,13 +5680,10 @@ const getEagerSuffix = (tokens) => {
5710
5680
  let suffix = "";
5711
5681
  for (const token of tokens) {
5712
5682
  if (token.type === "input") {
5713
- if (token.optional)
5714
- continue;
5715
- else
5716
- break;
5683
+ if (token.optional) continue;
5684
+ else break;
5717
5685
  }
5718
- if (!token.displayEagerly)
5719
- break;
5686
+ if (!token.displayEagerly) break;
5720
5687
  suffix += token.char;
5721
5688
  }
5722
5689
  return suffix;
@@ -5744,12 +5711,11 @@ const matchAgainstMask = (pureValue, mask, acceptObscuredValue = false) => {
5744
5711
  while (true) {
5745
5712
  const char = charsToProcess[0];
5746
5713
  const token = tokensToProcess[0];
5747
- if (!char && !tokensToProcess.some((t) => t.type === "input" && !t.optional))
5748
- return {
5749
- outcome: "correct",
5750
- displayValue: displayValue() + getEagerSuffix(tokensToProcess),
5751
- potentialForMoreOptionalInput: getPotentialForMoreOptionalInput(tokensToProcess)
5752
- };
5714
+ if (!char && !tokensToProcess.some((t) => t.type === "input" && !t.optional)) return {
5715
+ outcome: "correct",
5716
+ displayValue: displayValue() + getEagerSuffix(tokensToProcess),
5717
+ potentialForMoreOptionalInput: getPotentialForMoreOptionalInput(tokensToProcess)
5718
+ };
5753
5719
  if (!char) {
5754
5720
  const output = shiftRight(mask.possibleShifts, matchedTokens, tokensToProcess);
5755
5721
  matchedTokens = output.matchedTokens;
@@ -5759,24 +5725,22 @@ const matchAgainstMask = (pureValue, mask, acceptObscuredValue = false) => {
5759
5725
  displayValue: displayValue() + getEagerSuffix(tokensToProcess)
5760
5726
  };
5761
5727
  }
5762
- if (!token)
5763
- return {
5764
- outcome: "mismatch",
5765
- badChar: char,
5766
- mismatchAtChar: charIndex,
5767
- mismatchedToken: "inputTooLong",
5768
- partialDisplayValue: displayValue()
5769
- };
5728
+ if (!token) return {
5729
+ outcome: "mismatch",
5730
+ badChar: char,
5731
+ mismatchAtChar: charIndex,
5732
+ mismatchedToken: "inputTooLong",
5733
+ partialDisplayValue: displayValue()
5734
+ };
5770
5735
  if (token.type === "nonInput") {
5771
5736
  if (token.includeInValue) {
5772
- if (char !== token.char)
5773
- return {
5774
- outcome: "mismatch",
5775
- badChar: char,
5776
- mismatchAtChar: charIndex,
5777
- mismatchedToken: token,
5778
- partialDisplayValue: displayValue()
5779
- };
5737
+ if (char !== token.char) return {
5738
+ outcome: "mismatch",
5739
+ badChar: char,
5740
+ mismatchAtChar: charIndex,
5741
+ mismatchedToken: token,
5742
+ partialDisplayValue: displayValue()
5743
+ };
5780
5744
  shiftChars(1);
5781
5745
  }
5782
5746
  matchedTokens.push(token);
@@ -5785,14 +5749,13 @@ const matchAgainstMask = (pureValue, mask, acceptObscuredValue = false) => {
5785
5749
  if (token.type === "input") {
5786
5750
  const availableTokens = getAvailableInputTokens(tokensToProcess);
5787
5751
  const matchingToken = findMatchingToken(availableTokens, char);
5788
- if (!matchingToken)
5789
- return {
5790
- outcome: "mismatch",
5791
- badChar: char,
5792
- mismatchAtChar: charIndex,
5793
- mismatchedToken: token,
5794
- partialDisplayValue: displayValue()
5795
- };
5752
+ if (!matchingToken) return {
5753
+ outcome: "mismatch",
5754
+ badChar: char,
5755
+ mismatchAtChar: charIndex,
5756
+ mismatchedToken: token,
5757
+ partialDisplayValue: displayValue()
5758
+ };
5796
5759
  matchedTokens.push({
5797
5760
  ...matchingToken,
5798
5761
  char
@@ -5803,30 +5766,26 @@ const matchAgainstMask = (pureValue, mask, acceptObscuredValue = false) => {
5803
5766
  }
5804
5767
  };
5805
5768
  const deriveInputState = (isValid, isFocused, hasBlurred, isDisabled, errorMessage, shouldValidate, potentiallyMoreOptionalCharacters, formatGuidance, i18n) => {
5806
- if (isDisabled)
5807
- return {
5808
- isError: false
5809
- };
5810
- if (isValid && (!potentiallyMoreOptionalCharacters || !isFocused))
5811
- return {
5812
- isError: false,
5813
- text: jsxs(Fragment, {
5814
- children: [jsx(Icon, {
5815
- name: "checkmark-small",
5816
- className: "adyen-kyc-helper-text__valid-format-check"
5817
- }), i18n.get("formatIsCorrect")]
5818
- })
5819
- };
5820
- if (isFocused && formatGuidance)
5821
- return {
5822
- isError: false,
5823
- text: formatGuidance
5824
- };
5825
- if (!isValid && (shouldValidate || hasBlurred))
5826
- return {
5827
- isError: true,
5828
- text: typeof errorMessage === "string" && errorMessage ? errorMessage : formatGuidance
5829
- };
5769
+ if (isDisabled) return {
5770
+ isError: false
5771
+ };
5772
+ if (isValid && (!potentiallyMoreOptionalCharacters || !isFocused)) return {
5773
+ isError: false,
5774
+ text: jsxs(Fragment, {
5775
+ children: [jsx(Icon, {
5776
+ name: "checkmark-small",
5777
+ className: "adyen-kyc-helper-text__valid-format-check"
5778
+ }), i18n.get("formatIsCorrect")]
5779
+ })
5780
+ };
5781
+ if (isFocused && formatGuidance) return {
5782
+ isError: false,
5783
+ text: formatGuidance
5784
+ };
5785
+ if (!isValid && (shouldValidate || hasBlurred)) return {
5786
+ isError: true,
5787
+ text: typeof errorMessage === "string" && errorMessage ? errorMessage : formatGuidance
5788
+ };
5830
5789
  return {
5831
5790
  isError: false
5832
5791
  };
@@ -5862,12 +5821,10 @@ const MaskedInputText = ({
5862
5821
  i18n
5863
5822
  } = useI18nContext();
5864
5823
  const onMismatch = (mismatch) => {
5865
- if (!inputRef.current)
5866
- return;
5824
+ if (!inputRef.current) return;
5867
5825
  setShowingMismatch(true);
5868
5826
  inputRef.current.addEventListener("animationend", (event) => {
5869
- if (event.animationName !== MISMATCH_ANIMATION_NAME)
5870
- return;
5827
+ if (event.animationName !== MISMATCH_ANIMATION_NAME) return;
5871
5828
  setShowingMismatch(false);
5872
5829
  });
5873
5830
  onMismatchExternal == null ? void 0 : onMismatchExternal(mismatch);
@@ -5878,16 +5835,14 @@ const MaskedInputText = ({
5878
5835
  }
5879
5836
  }, [mask]);
5880
5837
  const getMaskResult = useCallback((pureValue) => {
5881
- if (!mask)
5882
- return {
5883
- outcome: "partialCorrect",
5884
- displayValue: pureValue
5885
- };
5838
+ if (!mask) return {
5839
+ outcome: "partialCorrect",
5840
+ displayValue: pureValue
5841
+ };
5886
5842
  return matchAgainstMask(transformOnType ? transformOnType(pureValue) : pureValue, mask, acceptObscuredValue);
5887
5843
  }, [mask, transformOnType, acceptObscuredValue]);
5888
5844
  const displayValueToPure = useCallback((displayValue2) => {
5889
- if (!mask)
5890
- return displayValue2;
5845
+ if (!mask) return displayValue2;
5891
5846
  return displayValueToPureValue(displayValue2, mask);
5892
5847
  }, [mask]);
5893
5848
  const maskResult = useMemo(() => getMaskResult(value), [getMaskResult, value]);
@@ -5917,8 +5872,7 @@ Falling back to partially valid value "${fallback}"`);
5917
5872
  const newPureValue = displayValueToPure(inputEl.value);
5918
5873
  const newMaskResult = getMaskResult(newPureValue);
5919
5874
  const returnCaretLater = (offset = 0) => {
5920
- if (!inputEl.selectionStart)
5921
- return;
5875
+ if (!inputEl.selectionStart) return;
5922
5876
  setCaretReturnPosition(inputEl.selectionStart + offset);
5923
5877
  };
5924
5878
  const cancelInput = () => {
@@ -5963,8 +5917,7 @@ Falling back to partially valid value "${fallback}"`);
5963
5917
  selectionStart,
5964
5918
  selectionEnd
5965
5919
  } = inputEl;
5966
- if (!pasteValue || !selectionStart || selectionStart !== selectionEnd)
5967
- return;
5920
+ if (!pasteValue || !selectionStart || selectionStart !== selectionEnd) return;
5968
5921
  const pureDisplayValue = displayValueToPure(displayValue);
5969
5922
  const purePasteValue = displayValueToPure(pasteValue);
5970
5923
  const newPureValue = pureDisplayValue.slice(0, selectionStart) + purePasteValue + pureDisplayValue.slice(selectionStart);
@@ -5983,8 +5936,7 @@ Falling back to partially valid value "${fallback}"`);
5983
5936
  onKeyDown: (event) => {
5984
5937
  const inputEl = event.target;
5985
5938
  const isCaretAtEndWithNoSelection = inputEl.selectionStart === inputEl.value.length && inputEl.selectionStart === inputEl.selectionEnd;
5986
- if (event.key !== KEYBOARD_KEYS.backspace || !isCaretAtEndWithNoSelection)
5987
- return;
5939
+ if (event.key !== KEYBOARD_KEYS.backspace || !isCaretAtEndWithNoSelection) return;
5988
5940
  event.preventDefault();
5989
5941
  const withLastCharRemoved = value.slice(0, value.length - 1);
5990
5942
  const newMaskResult = getMaskResult(withLastCharRemoved);
@@ -6121,8 +6073,7 @@ const companyRegistrationNumberOptions = {
6121
6073
  };
6122
6074
  const getCompanyRegistrationNumberOptions = (country2, companyType2) => {
6123
6075
  const optionsForCountry = companyRegistrationNumberOptions[country2];
6124
- if (!companyType2 || !optionsForCountry)
6125
- return optionsForCountry;
6076
+ if (!companyType2 || !optionsForCountry) return optionsForCountry;
6126
6077
  return optionsForCountry.filter((option) => {
6127
6078
  var _a;
6128
6079
  return ((_a = option.applicableOnlyFor) == null ? void 0 : _a.includes(companyType2)) ?? true;
@@ -6188,8 +6139,7 @@ const taxIdNumberOptions = {
6188
6139
  };
6189
6140
  const getTaxIdNumberOptions = (country2, companyType2) => {
6190
6141
  const optionsForCountry = taxIdNumberOptions[country2];
6191
- if (!companyType2 || !optionsForCountry)
6192
- return optionsForCountry;
6142
+ if (!companyType2 || !optionsForCountry) return optionsForCountry;
6193
6143
  return optionsForCountry.filter((option) => {
6194
6144
  var _a;
6195
6145
  return ((_a = option.applicableOnlyFor) == null ? void 0 : _a.includes(companyType2)) ?? true;
@@ -6217,8 +6167,7 @@ function CompanyRegistrationNumberTypeSelector({
6217
6167
  }, [exemptedOption, setSelected]);
6218
6168
  const options = useMemo(() => {
6219
6169
  const availableOptions = getCompanyRegistrationNumberOptions(country2, companyType2) ?? [];
6220
- if (availableOptions.length === 0 || !exemptedOption)
6221
- return availableOptions;
6170
+ if (availableOptions.length === 0 || !exemptedOption) return availableOptions;
6222
6171
  return [...availableOptions, {
6223
6172
  id: "exempted",
6224
6173
  name: exemptedOption
@@ -6229,8 +6178,7 @@ function CompanyRegistrationNumberTypeSelector({
6229
6178
  setSelected(options[0].id);
6230
6179
  }
6231
6180
  }, [options, selected, setSelected]);
6232
- if (options.length <= 1)
6233
- return null;
6181
+ if (options.length <= 1) return null;
6234
6182
  return jsx(Field, {
6235
6183
  name: "companyRegistrationNumberType",
6236
6184
  label: i18n.get("whichTypeOfRegistrationNumberDoYouHave"),
@@ -7441,15 +7389,13 @@ const defaultFieldConfig$8 = {
7441
7389
  const inferCompanyRegistrationNumberType = (registrationNumber2, country2, companyType2) => {
7442
7390
  const optionsForCountry = companyRegistrationNumberOptions[country2];
7443
7391
  const metadataFn = defaultFieldConfig$8[country2];
7444
- if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function")
7445
- return void 0;
7392
+ if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function") return void 0;
7446
7393
  for (const option of optionsForCountry) {
7447
7394
  const fieldMetadata = metadataFn({
7448
7395
  companyType: companyType2,
7449
7396
  registrationNumberType: option.id
7450
7397
  });
7451
- if (!fieldMetadata.validators)
7452
- continue;
7398
+ if (!fieldMetadata.validators) continue;
7453
7399
  const validators = Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators];
7454
7400
  if (validators.every((validator) => validator.validate(registrationNumber2))) {
7455
7401
  return option.id;
@@ -8748,15 +8694,13 @@ const defaultFieldConfig$6 = {
8748
8694
  const inferTaxIdNumberType = (taxId2, country2) => {
8749
8695
  const optionsForCountry = taxIdNumberOptions[country2];
8750
8696
  const metadataFn = defaultFieldConfig$6[country2] ?? defaultFieldConfig$7[country2];
8751
- if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function")
8752
- return void 0;
8697
+ if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function") return void 0;
8753
8698
  for (const option of optionsForCountry) {
8754
8699
  const fieldMetadata = metadataFn({
8755
8700
  taxIdNumberType: option.id,
8756
8701
  vatNumberType: option.id
8757
8702
  });
8758
- if (!fieldMetadata.validators)
8759
- continue;
8703
+ if (!fieldMetadata.validators) continue;
8760
8704
  const validators = Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators];
8761
8705
  if (validators.every((validator) => validator.validate(taxId2))) {
8762
8706
  return option.id;
@@ -8785,8 +8729,7 @@ function TaxIdNumberTypeSelector({
8785
8729
  }, [exemptedOption, setSelected]);
8786
8730
  const options = useMemo(() => {
8787
8731
  const availableOptions = getTaxIdNumberOptions(country2, companyType2) ?? [];
8788
- if (availableOptions.length === 0 || !exemptedOption)
8789
- return availableOptions;
8732
+ if (availableOptions.length === 0 || !exemptedOption) return availableOptions;
8790
8733
  return [...availableOptions, {
8791
8734
  id: "exempted",
8792
8735
  name: exemptedOption
@@ -8797,8 +8740,7 @@ function TaxIdNumberTypeSelector({
8797
8740
  handleSelect(options[0].id);
8798
8741
  }
8799
8742
  }, [options, selected, handleSelect]);
8800
- if (options.length <= 1)
8801
- return null;
8743
+ if (options.length <= 1) return null;
8802
8744
  return jsx(Field, {
8803
8745
  name: "taxIdNumberType",
8804
8746
  label: i18n.get("whichTypeOfTaxIdNumberDoYouHave"),
@@ -9020,8 +8962,7 @@ function VatNumber(props) {
9020
8962
  }
9021
8963
  });
9022
8964
  }, [data, valid, errors, isValid]);
9023
- if (!formUtils.isRequiredField("vatNumber"))
9024
- return null;
8965
+ if (!formUtils.isRequiredField("vatNumber")) return null;
9025
8966
  const exemptionIsPossible = ((_b = mergedProps.requiredFields) == null ? void 0 : _b.includes("exemptedFromVat")) ?? false;
9026
8967
  const showTaxIdExemptedOption = exemptionIsPossible && ((_c = taxIdNumberOptions[country2]) == null ? void 0 : _c.length) > 1;
9027
8968
  const handleTaxIdNumberTypeChange = (taxIdType) => {
@@ -9969,10 +9910,9 @@ const EntityTypeSelectionRadioCardBody = ({
9969
9910
  const {
9970
9911
  i18n
9971
9912
  } = useI18nContext();
9972
- if (!examples)
9973
- return jsx("span", {
9974
- children: i18n.get(description2)
9975
- });
9913
+ if (!examples) return jsx("span", {
9914
+ children: i18n.get(description2)
9915
+ });
9976
9916
  return jsxs(Fragment, {
9977
9917
  children: [jsx("span", {
9978
9918
  className: "adyen-kyc-entity-type-radio-group-card__description",
@@ -9991,8 +9931,7 @@ const EntityTypeSelectionRadioCardBody = ({
9991
9931
  const CoreContext = createContext(void 0);
9992
9932
  const useCoreContext = () => {
9993
9933
  const context = useContext(CoreContext);
9994
- if (!context)
9995
- throw Error("You need a <CoreProvider> to use core context");
9934
+ if (!context) throw Error("You need a <CoreProvider> to use core context");
9996
9935
  return context;
9997
9936
  };
9998
9937
  var TrustMemberTypes = /* @__PURE__ */ ((TrustMemberTypes2) => {
@@ -10205,22 +10144,17 @@ function getNestedPropertyKeys(obj, includeUndefined = false) {
10205
10144
  return fieldNames;
10206
10145
  }
10207
10146
  const getTaskStatus = (type, capabilityProblems, rootLegalEntity, entityIds, skipPendingCapabilitiesCheck = false) => {
10208
- if (!(entityIds == null ? void 0 : entityIds.length) || entityIds.includes(rootLegalEntity.id) && isEmptyEntity(rootLegalEntity))
10209
- return TaskStatus.EMPTY;
10147
+ if (!(entityIds == null ? void 0 : entityIds.length) || entityIds.includes(rootLegalEntity.id) && isEmptyEntity(rootLegalEntity)) return TaskStatus.EMPTY;
10210
10148
  const importantCapabilityStatus = checkForImportantCapabilityStatus(type, capabilityProblems, entityIds);
10211
- if (importantCapabilityStatus)
10212
- return importantCapabilityStatus;
10213
- if (!skipPendingCapabilitiesCheck && hasPendingCapabilities(rootLegalEntity))
10214
- return TaskStatus.PROCESSING;
10149
+ if (importantCapabilityStatus) return importantCapabilityStatus;
10150
+ if (!skipPendingCapabilitiesCheck && hasPendingCapabilities(rootLegalEntity)) return TaskStatus.PROCESSING;
10215
10151
  return TaskStatus.FINISHED;
10216
10152
  };
10217
10153
  const IMPORTANT_STATUSES = [TaskStatus.DETAILS_REQUIRED, TaskStatus.DOWNLOAD, TaskStatus.ERROR, TaskStatus.PROCESSING];
10218
10154
  function checkForImportantCapabilityStatus(type, capabilityProblems, entityIds) {
10219
- if (!(capabilityProblems == null ? void 0 : capabilityProblems[type]) || !entityIds)
10220
- return;
10155
+ if (!(capabilityProblems == null ? void 0 : capabilityProblems[type]) || !entityIds) return;
10221
10156
  const importantStatuses = Object.entries(capabilityProblems[type] ?? {}).filter(([key]) => entityIds == null ? void 0 : entityIds.includes(key)).map(([, value]) => value.status).filter((status) => status !== void 0 && IMPORTANT_STATUSES.includes(status));
10222
- if (!importantStatuses.length)
10223
- return;
10157
+ if (!importantStatuses.length) return;
10224
10158
  return importantStatuses.reduce((prev, curr) => curr > prev ? curr : prev);
10225
10159
  }
10226
10160
  const hasPendingCapabilities = (legalEntityResponse) => Object.values(legalEntityResponse.capabilities ?? {}).some((capability) => capability.verificationStatus === "pending");
@@ -10239,14 +10173,11 @@ const emptyFieldsByEntityType = {
10239
10173
  function isEmptyEntity(legalEntity) {
10240
10174
  var _a;
10241
10175
  const type = legalEntity == null ? void 0 : legalEntity.type;
10242
- if (!type)
10243
- return true;
10244
- if ((_a = legalEntity.documentDetails) == null ? void 0 : _a.length)
10245
- return false;
10176
+ if (!type) return true;
10177
+ if ((_a = legalEntity.documentDetails) == null ? void 0 : _a.length) return false;
10246
10178
  const minimumFields = emptyFieldsByEntityType[type];
10247
10179
  const typeSpecificSection = legalEntity[type];
10248
- if (!typeSpecificSection)
10249
- return true;
10180
+ if (!typeSpecificSection) return true;
10250
10181
  const fieldsOnEntity = getNestedPropertyKeys(typeSpecificSection);
10251
10182
  return !fieldsOnEntity.some((field) => !minimumFields.includes(field));
10252
10183
  }
@@ -10257,9 +10188,11 @@ const entityTypeToCorrespondingAccountHolderOption = {
10257
10188
  [LegalEntityType.SOLE_PROPRIETORSHIP]: "mySoleProprietorName",
10258
10189
  [LegalEntityType.TRUST]: "aTrust"
10259
10190
  };
10260
- const getDefaultAccountHolderType = (legalEntityResponse, isTypeChanging = false) => {
10261
- if (!(legalEntityResponse == null ? void 0 : legalEntityResponse.type))
10262
- return void 0;
10191
+ const getDefaultAccountHolderType = (legalEntityResponse, isTypeChanging = false, accountHolder2) => {
10192
+ if (accountHolder2) {
10193
+ return accountHolder2;
10194
+ }
10195
+ if (!(legalEntityResponse == null ? void 0 : legalEntityResponse.type)) return void 0;
10263
10196
  if (hasOwnEntityAssociationOfType(LegalEntityType.SOLE_PROPRIETORSHIP, legalEntityResponse.entityAssociations, legalEntityResponse.id)) {
10264
10197
  return "mySoleProprietorName";
10265
10198
  }
@@ -10510,6 +10443,7 @@ const companyTypeValidationRules = {
10510
10443
  };
10511
10444
  const companyTypeFields = ["entityType", ...accountHolderFields];
10512
10445
  function CompanyTypeComponent(props) {
10446
+ var _a;
10513
10447
  const {
10514
10448
  i18n
10515
10449
  } = useI18nContext();
@@ -10540,8 +10474,8 @@ function CompanyTypeComponent(props) {
10540
10474
  const formUtils = formUtilities(props, i18n);
10541
10475
  const accountHolderProps = getFieldProps(props, accountHolderFields);
10542
10476
  useEffect(() => {
10543
- var _a, _b;
10544
- (_b = (_a = stateRef.current) == null ? void 0 : _a.setState) == null ? void 0 : _b.call(_a, {
10477
+ var _a2, _b;
10478
+ (_b = (_a2 = stateRef.current) == null ? void 0 : _a2.setState) == null ? void 0 : _b.call(_a2, {
10545
10479
  type: "addToState",
10546
10480
  value: {
10547
10481
  data,
@@ -10554,7 +10488,7 @@ function CompanyTypeComponent(props) {
10554
10488
  }
10555
10489
  });
10556
10490
  }, [data, valid, errors, isValid]);
10557
- const companyTypeOptions = isNewEntryFlowEnabled ? companyTypes.filter((companyType2) => companyType2.id !== CompanyTypesValue.INCORPORATED_PARTNERSHIP && companyType2.id !== CompanyTypesValue.INCORPORATED_ASSOCIATION) : companyTypes;
10491
+ 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;
10558
10492
  const companyTypeExamples2 = useCompanyTypeExamples(country2);
10559
10493
  return jsxs(Fragment, {
10560
10494
  children: [jsx(StateContextSetter, {
@@ -10700,11 +10634,9 @@ function DocumentGuidance({
10700
10634
  }
10701
10635
  function bytesToSize(bytes) {
10702
10636
  const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
10703
- if (bytes === 0)
10704
- return "n/a";
10637
+ if (bytes === 0) return "n/a";
10705
10638
  const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)).toString());
10706
- if (i === 0)
10707
- return `${bytes} ${sizes[i]}`;
10639
+ if (i === 0) return `${bytes} ${sizes[i]}`;
10708
10640
  return `${(bytes / 1024 ** i).toFixed()} ${sizes[i]}`;
10709
10641
  }
10710
10642
  const isExistingFile = (file) => "existing" in file && file.existing;
@@ -10721,11 +10653,9 @@ function DropzoneFile(props) {
10721
10653
  } = useI18nContext();
10722
10654
  const formatSize = (bytes) => {
10723
10655
  const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
10724
- if (!bytes || bytes === 0)
10725
- return "n/a";
10656
+ if (!bytes || bytes === 0) return "n/a";
10726
10657
  const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)).toString());
10727
- if (i === 0)
10728
- return `${bytes} ${sizes[i]}`;
10658
+ if (i === 0) return `${bytes} ${sizes[i]}`;
10729
10659
  return `${(bytes / 1024 ** i).toFixed(1)} ${sizes[i]}`;
10730
10660
  };
10731
10661
  return jsxs("div", {
@@ -10781,40 +10711,35 @@ const fileValidationRules = ({
10781
10711
  isOptional
10782
10712
  }) => [{
10783
10713
  validate: (files) => {
10784
- if (isOptional && (!files || files.length === 0))
10785
- return true;
10714
+ if (isOptional && (!files || files.length === 0)) return true;
10786
10715
  return Boolean(files && files.length > 0);
10787
10716
  },
10788
10717
  errorMessage: "fieldIsRequired",
10789
10718
  modes: ["blur", "input"]
10790
10719
  }, {
10791
10720
  validate: (files) => {
10792
- if (!files)
10793
- return true;
10721
+ if (!files) return true;
10794
10722
  return files.length <= maxNumberOfFiles;
10795
10723
  },
10796
10724
  errorMessage: "tooManyFiles",
10797
10725
  modes: ["blur", "input"]
10798
10726
  }, {
10799
10727
  validate: (files) => {
10800
- if (!files)
10801
- return true;
10728
+ if (!files) return true;
10802
10729
  return !hasDuplicates(files.map((file) => file.name));
10803
10730
  },
10804
10731
  errorMessage: "duplicatedFiles",
10805
10732
  modes: ["blur", "input"]
10806
10733
  }, {
10807
10734
  validate: (files) => {
10808
- if (!files)
10809
- return true;
10735
+ if (!files) return true;
10810
10736
  return filterOnlyNewlyUploadedFiles(files).every((file) => allowedFileTypes.some((filetype) => file.name.toLowerCase().endsWith(filetype.toLowerCase())));
10811
10737
  },
10812
10738
  errorMessage: "unsupportedFiletype",
10813
10739
  modes: ["blur", "input"]
10814
10740
  }, {
10815
10741
  validate: (files) => {
10816
- if (!files)
10817
- return true;
10742
+ if (!files) return true;
10818
10743
  return filterOnlyNewlyUploadedFiles(files).every((file) => !file.size || file.size < maxSize);
10819
10744
  },
10820
10745
  errorMessage: "maximumFileSizeExceeded",
@@ -11136,10 +11061,9 @@ function DocumentUploadComponent({
11136
11061
  }, [data, valid, errors, fieldProblems]);
11137
11062
  useEffect(() => {
11138
11063
  var _a2, _b;
11139
- if (documentField)
11140
- setDocument({
11141
- [documentField]: (_a2 = props == null ? void 0 : props.data) == null ? void 0 : _a2[documentField]
11142
- });
11064
+ if (documentField) setDocument({
11065
+ [documentField]: (_a2 = props == null ? void 0 : props.data) == null ? void 0 : _a2[documentField]
11066
+ });
11143
11067
  setData("description", (_b = props.data) == null ? void 0 : _b.description);
11144
11068
  triggerValidation();
11145
11069
  }, [props.data]);
@@ -11344,8 +11268,7 @@ function StateField({
11344
11268
  } = useDataset(datasetIdentifier.state(selectedCountry), !selectedCountry || !COUNTRIES_WITH_STATES_DATASET.includes(selectedCountry));
11345
11269
  const labelKey = getKeyForField("stateOrProvince", selectedCountry);
11346
11270
  const placeholderKey = getKeyForField("stateOrProvincePlaceholder", selectedCountry);
11347
- if (!loaded || !states.length)
11348
- return null;
11271
+ if (!loaded || !states.length) return null;
11349
11272
  return jsx(Field, {
11350
11273
  name: "stateOrProvince",
11351
11274
  label: (labels2 == null ? void 0 : labels2.stateOrProvince) || i18n.get(labelKey),
@@ -11459,14 +11382,12 @@ function useIsElementVisible(ref, fallback = true) {
11459
11382
  const [isOnScreen, setIsOnScreen] = useState(isIntersectionObserverSupported ? false : fallback);
11460
11383
  const observerRef = useRef();
11461
11384
  useEffect(() => {
11462
- if (!isIntersectionObserverSupported)
11463
- return;
11385
+ if (!isIntersectionObserverSupported) return;
11464
11386
  observerRef.current = new IntersectionObserver(([entry]) => setIsOnScreen(entry.isIntersecting));
11465
11387
  }, []);
11466
11388
  useEffect(() => {
11467
11389
  var _a;
11468
- if (!ref.current)
11469
- return;
11390
+ if (!ref.current) return;
11470
11391
  (_a = observerRef.current) == null ? void 0 : _a.observe(ref.current);
11471
11392
  return () => {
11472
11393
  var _a2;
@@ -11902,8 +11823,7 @@ const countrySpecificFormatters = {
11902
11823
  postalCode: {
11903
11824
  // Formatter - excludes non digits & hyphens and limits to a maxlength that varies depending on whether a hyphen is present or not
11904
11825
  formatter: (val) => {
11905
- if (!val)
11906
- return void 0;
11826
+ if (!val) return void 0;
11907
11827
  const nuVal = val.replace(getFormattingRegEx("^\\d-", "g"), "");
11908
11828
  const maxlength = nuVal.includes("-") ? 6 : 5;
11909
11829
  return nuVal.substring(0, maxlength);
@@ -11915,8 +11835,7 @@ const countrySpecificFormatters = {
11915
11835
  [CountryCodes.Portugal]: {
11916
11836
  postalCode: {
11917
11837
  formatter: (val) => {
11918
- if (!val)
11919
- return void 0;
11838
+ if (!val) return void 0;
11920
11839
  const nuVal = val.replace(getFormattingRegEx("^\\d-", "g"), "");
11921
11840
  return nuVal.substring(0, 8);
11922
11841
  },
@@ -12134,8 +12053,7 @@ function Address(props) {
12134
12053
  }
12135
12054
  }, [shouldValidate]);
12136
12055
  const getComponent = (fieldName) => {
12137
- if (!formUtils.isRequiredField(fieldName))
12138
- return null;
12056
+ if (!formUtils.isRequiredField(fieldName)) return null;
12139
12057
  const hideField = fieldName === "country" && hideCountry;
12140
12058
  return jsx(FieldContainer, {
12141
12059
  classNameModifiers: [fieldName],
@@ -12145,7 +12063,7 @@ function Address(props) {
12145
12063
  fieldProblems,
12146
12064
  fieldName,
12147
12065
  handleChangeFor,
12148
- maxlength: getMaxLengthByFieldAndCountry(countrySpecificFormatters, fieldName, data.country, true),
12066
+ maxlength: getMaxLengthByFieldAndCountry(countrySpecificFormatters, fieldName, data.country),
12149
12067
  hideField,
12150
12068
  "aria-label": formUtils.getLabel(fieldName, fieldName),
12151
12069
  trimOnBlur: true
@@ -12893,8 +12811,7 @@ const uploadDocuments = async (documents2, entityId) => {
12893
12811
  return documentStore[entityId];
12894
12812
  };
12895
12813
  const updateEntityDocuments = (uploadedDocuments, entityId) => {
12896
- if (!documentStore[entityId])
12897
- documentStore[entityId] = [];
12814
+ if (!documentStore[entityId]) documentStore[entityId] = [];
12898
12815
  uploadedDocuments.forEach((uploadedDocument) => {
12899
12816
  if (uploadedDocument) {
12900
12817
  const existingDocumentIndex = documentStore[entityId].findIndex((document2) => document2.id === uploadedDocument.id);
@@ -13085,11 +13002,10 @@ const rules$2 = ({
13085
13002
  });
13086
13003
  const getAccountIdentificationFromPayoutAccountSchema = (payoutAccount2, bankCountry2) => {
13087
13004
  var _a;
13088
- if ("iban" in payoutAccount2 && payoutAccount2.iban)
13089
- return {
13090
- type: "iban",
13091
- iban: payoutAccount2.iban
13092
- };
13005
+ if ("iban" in payoutAccount2 && payoutAccount2.iban) return {
13006
+ type: "iban",
13007
+ iban: payoutAccount2.iban
13008
+ };
13093
13009
  const countryPrefix = bankCountry2 === "GB" ? "uk" : bankCountry2.toLowerCase();
13094
13010
  const localAccount = {
13095
13011
  type: `${countryPrefix}Local`,
@@ -13593,7 +13509,7 @@ const mapIndividualToLegalEntity = (data) => {
13593
13509
  }
13594
13510
  return requestObj;
13595
13511
  };
13596
- const mapLegalEntityToCompany = (legalEntity, isChangingType) => {
13512
+ const mapLegalEntityToCompany = (legalEntity, isChangingType, accountHolder2) => {
13597
13513
  var _a, _b, _c, _d;
13598
13514
  let companyCompData;
13599
13515
  if (legalEntity == null ? void 0 : legalEntity.organization) {
@@ -13638,7 +13554,7 @@ const mapLegalEntityToCompany = (legalEntity, isChangingType) => {
13638
13554
  ...companyCompData,
13639
13555
  companyType: {
13640
13556
  ...companyCompData == null ? void 0 : companyCompData.companyType,
13641
- accountHolder: getDefaultAccountHolderType(legalEntity, isChangingType)
13557
+ accountHolder: getDefaultAccountHolderType(legalEntity, isChangingType, accountHolder2)
13642
13558
  }
13643
13559
  };
13644
13560
  return companyCompData;
@@ -13775,11 +13691,9 @@ const mapSolePropToLegalEntity = (data) => {
13775
13691
  const getPage = ({
13776
13692
  attachments
13777
13693
  }, pageType) => {
13778
- if (!attachments)
13779
- throw Error("Document has no attachments");
13694
+ if (!attachments) throw Error("Document has no attachments");
13780
13695
  const attachment = pageType ? attachments.find((attach) => attach.pageType === pageType) : attachments[0];
13781
- if (!attachment)
13782
- throw Error(`Attachment not found${pageType ? ` with type '${pageType}'` : ""}`);
13696
+ if (!attachment) throw Error(`Attachment not found${pageType ? ` with type '${pageType}'` : ""}`);
13783
13697
  return attachment;
13784
13698
  };
13785
13699
  const getPageName = (document2, pageType) => getPage(document2, pageType).pageName;
@@ -14185,8 +14099,7 @@ const useIdVerificationToken = ({
14185
14099
  const hasAllUserDetails = userDetails && Object.values(userDetails).every(Boolean);
14186
14100
  useEffect(() => {
14187
14101
  (async () => {
14188
- if (!hasAllUserDetails)
14189
- return;
14102
+ if (!hasAllUserDetails) return;
14190
14103
  try {
14191
14104
  setLoadingStatus("loading");
14192
14105
  const data = {
@@ -14347,8 +14260,7 @@ function IdVerificationComponent({
14347
14260
  const onfidoSdk = useRef();
14348
14261
  useEffect(() => {
14349
14262
  (async () => {
14350
- if (!sdkToken2)
14351
- return;
14263
+ if (!sdkToken2) return;
14352
14264
  onfidoSdk.current = await initOnfido({
14353
14265
  token: sdkToken2,
14354
14266
  i18n,
@@ -14358,13 +14270,11 @@ function IdVerificationComponent({
14358
14270
  });
14359
14271
  })().catch(logger$p.error);
14360
14272
  return () => {
14361
- if (onfidoSdk.current)
14362
- onfidoSdk.current.tearDown();
14273
+ if (onfidoSdk.current) onfidoSdk.current.tearDown();
14363
14274
  };
14364
14275
  }, [sdkToken2]);
14365
14276
  useEffect(() => {
14366
- if (!onfidoSdk.current)
14367
- return;
14277
+ if (!onfidoSdk.current) return;
14368
14278
  onfidoSdk.current.setOptions({
14369
14279
  language: getOnfidoLocaleConfig(i18n)
14370
14280
  });
@@ -14530,8 +14440,7 @@ const layoutBreakpointSizes = {
14530
14440
  const getBreakpointClassNames = (containerSize) => {
14531
14441
  const breakPoints = Object.entries(layoutBreakpointSizes);
14532
14442
  const classes = breakPoints.reduce((acc, [bp, size]) => {
14533
- if (size <= containerSize)
14534
- acc.push(layoutBreakpointClassnames[bp]);
14443
+ if (size <= containerSize) acc.push(layoutBreakpointClassnames[bp]);
14535
14444
  return acc;
14536
14445
  }, []);
14537
14446
  return classes.length > 0 ? classes : ["adyen-layout-xs-only"];
@@ -14556,8 +14465,7 @@ const AutoResizer = ({
14556
14465
  const containerRef = useRef(null);
14557
14466
  useEffect(() => {
14558
14467
  const container = containerRef.current;
14559
- if (!container)
14560
- return;
14468
+ if (!container) return;
14561
14469
  const resizeObserver = new ResizeObserver((entries) => assignLayoutClasses(entries, container));
14562
14470
  resizeObserver.observe(container);
14563
14471
  return () => resizeObserver.unobserve(container);
@@ -14802,8 +14710,7 @@ function useVerification(fieldsToVerify, country2) {
14802
14710
  const verificationPromises = [];
14803
14711
  fieldsToVerify.forEach((field) => {
14804
14712
  if (field === "idNumber" && formState.data[field]) {
14805
- if (formState.data[field] === savedData[field] || country2 === "US" && formState.data[field].length === 4)
14806
- return;
14713
+ if (formState.data[field] === savedData[field] || country2 === "US" && formState.data[field].length === 4) return;
14807
14714
  const request = {
14808
14715
  name: {
14809
14716
  firstName: formState.data.firstName,
@@ -14839,10 +14746,8 @@ function InputTelephone(props) {
14839
14746
  const staticPhoneValidationRules = (phonePrefixes, defaultPrefix) => ({
14840
14747
  phoneNumber: {
14841
14748
  validate: (phoneNumber2) => {
14842
- if (!phoneNumber2)
14843
- return false;
14844
- if (!phonePrefixes.length)
14845
- return phoneNumber2.startsWith("+");
14749
+ if (!phoneNumber2) return false;
14750
+ if (!phonePrefixes.length) return phoneNumber2.startsWith("+");
14846
14751
  return phonePrefixes.map((prefix) => prefix.name).some((name) => phoneNumber2.startsWith(name));
14847
14752
  },
14848
14753
  errorMessage: {
@@ -14862,8 +14767,7 @@ const useAsyncPhoneValidationRules = () => {
14862
14767
  phoneNumber: {
14863
14768
  asyncValidate: async (phoneNumber2) => {
14864
14769
  var _a;
14865
- if (!phoneNumber2)
14866
- return false;
14770
+ if (!phoneNumber2) return false;
14867
14771
  return (_a = await validatePhoneNumber2(phoneNumber2)) == null ? void 0 : _a.valid;
14868
14772
  },
14869
14773
  errorMessage: "invalidPhoneNumber",
@@ -15592,8 +15496,7 @@ function IdentityNumberComponent(props) {
15592
15496
  ...data
15593
15497
  };
15594
15498
  adjustedData.idNumber = data.idNumberExempt ? void 0 : data.idNumber;
15595
- if (data.idNumberExempt && formErrors.idNumber !== null)
15596
- setFormErrors("idNumber", null);
15499
+ if (data.idNumberExempt && formErrors.idNumber !== null) setFormErrors("idNumber", null);
15597
15500
  (_b = (_a = stateRef.current) == null ? void 0 : _a.setState) == null ? void 0 : _b.call(_a, {
15598
15501
  type: "addToState",
15599
15502
  value: {
@@ -15713,8 +15616,7 @@ const getRoleName = (role2) => {
15713
15616
  };
15714
15617
  const makeSelectItemForRole = (role2, i18n) => {
15715
15618
  const metadata = roleMetadata[role2];
15716
- if (!metadata)
15717
- throw Error(`Cannot make select item for role "${role2}"; no metadata found. Valid roles include: ${Object.keys(roleMetadata).join("\n")}`);
15619
+ if (!metadata) throw Error(`Cannot make select item for role "${role2}"; no metadata found. Valid roles include: ${Object.keys(roleMetadata).join("\n")}`);
15718
15620
  const {
15719
15621
  name,
15720
15622
  description: description2,
@@ -15728,11 +15630,9 @@ const makeSelectItemForRole = (role2, i18n) => {
15728
15630
  };
15729
15631
  };
15730
15632
  const handleKeys = (keys, callback, propagationMode = "stopIfMatches") => (event) => {
15731
- if (propagationMode === "stop")
15732
- event.stopPropagation();
15633
+ if (propagationMode === "stop") event.stopPropagation();
15733
15634
  if (keys.includes(event.key)) {
15734
- if (propagationMode === "stopIfMatches")
15735
- event.stopPropagation();
15635
+ if (propagationMode === "stopIfMatches") event.stopPropagation();
15736
15636
  callback();
15737
15637
  }
15738
15638
  };
@@ -15861,8 +15761,7 @@ function IndividualIdNumberTypeSelector({
15861
15761
  setSelected(options[0].id);
15862
15762
  }
15863
15763
  }, [options, selected, setSelected]);
15864
- if (options.length <= 1)
15865
- return null;
15764
+ if (options.length <= 1) return null;
15866
15765
  return jsx(Field, {
15867
15766
  name: "individualIdNumberType",
15868
15767
  label: i18n.get("whichTypeOfIdNumberDoYouHave"),
@@ -17335,14 +17234,12 @@ function FilePicker({
17335
17234
  const handleDrop = (e) => {
17336
17235
  e.preventDefault();
17337
17236
  e.stopPropagation();
17338
- if (e.dataTransfer)
17339
- addFiles(e.dataTransfer.files);
17237
+ if (e.dataTransfer) addFiles(e.dataTransfer.files);
17340
17238
  setDragged(false);
17341
17239
  };
17342
17240
  const handleFilesChosen = (e) => {
17343
17241
  const fileInput2 = e.target;
17344
- if (fileInput2.files)
17345
- addFiles(fileInput2.files);
17242
+ if (fileInput2.files) addFiles(fileInput2.files);
17346
17243
  };
17347
17244
  const addFiles = (newFiles) => {
17348
17245
  setFiles([...newFiles, ...files]);
@@ -17675,8 +17572,7 @@ function BankDocument(props) {
17675
17572
  var _a2;
17676
17573
  if (hasAlreadyUploadedDocuments) {
17677
17574
  setData("bankStatementDocument", alreadyUploadedDocuments);
17678
- if ((_a2 = props.data) == null ? void 0 : _a2.description)
17679
- setData("description", props.data.description);
17575
+ if ((_a2 = props.data) == null ? void 0 : _a2.description) setData("description", props.data.description);
17680
17576
  triggerValidation();
17681
17577
  }
17682
17578
  }, [alreadyUploadedDocuments, hasAlreadyUploadedDocuments, (_b = props.data) == null ? void 0 : _b.description, setData, triggerValidation]);
@@ -18128,12 +18024,10 @@ const httpDelete = async (options, data) => http({
18128
18024
  }, data);
18129
18025
  const removeElementSiblings = (element) => {
18130
18026
  const parent = element.parentNode;
18131
- if (!parent)
18132
- return;
18027
+ if (!parent) return;
18133
18028
  let child = parent.firstChild;
18134
18029
  while (child) {
18135
- if (child !== element)
18136
- parent.removeChild(child);
18030
+ if (child !== element) parent.removeChild(child);
18137
18031
  child = child.nextSibling;
18138
18032
  }
18139
18033
  };
@@ -18147,8 +18041,7 @@ const isTerminalMessageData = (data) => isObjectData(data) && Object.entries(dat
18147
18041
  const parseMessageJson = (message) => {
18148
18042
  try {
18149
18043
  const messageData = JSON.parse(message);
18150
- if (!RELEVANT_MESSAGE_TYPES.includes(messageData.type))
18151
- return "invalid";
18044
+ if (!RELEVANT_MESSAGE_TYPES.includes(messageData.type)) return "invalid";
18152
18045
  return messageData;
18153
18046
  } catch {
18154
18047
  return "invalid";
@@ -18175,8 +18068,7 @@ class IFrameWidget {
18175
18068
  this.listener = async (message) => {
18176
18069
  try {
18177
18070
  const result = await this.handleMessage(message);
18178
- if (!result)
18179
- return;
18071
+ if (!result) return;
18180
18072
  resolve(result);
18181
18073
  } catch (err) {
18182
18074
  reject(err);
@@ -18195,8 +18087,7 @@ class IFrameWidget {
18195
18087
  this.sdkToken = sdkToken2;
18196
18088
  }
18197
18089
  removeMessageEventListener() {
18198
- if (!this.listener)
18199
- return;
18090
+ if (!this.listener) return;
18200
18091
  window.removeEventListener("message", this.listener);
18201
18092
  this.listener = void 0;
18202
18093
  }
@@ -18205,19 +18096,16 @@ class IFrameWidget {
18205
18096
  origin,
18206
18097
  source
18207
18098
  }) {
18208
- if (source !== this.iframeWindow || origin !== this.iframeUrl.origin)
18209
- return;
18099
+ if (source !== this.iframeWindow || origin !== this.iframeUrl.origin) return;
18210
18100
  if (this.vendor !== TINK_VENDOR && isTerminalMessageData(data)) {
18211
18101
  if (Object.getOwnPropertyNames(data).includes("error")) {
18212
18102
  throw data;
18213
18103
  }
18214
18104
  return data;
18215
18105
  }
18216
- if (!isString(data))
18217
- return;
18106
+ if (!isString(data)) return;
18218
18107
  const jsonData = parseMessageJson(data);
18219
- if (jsonData === "invalid")
18220
- return;
18108
+ if (jsonData === "invalid") return;
18221
18109
  const httpOptions = {
18222
18110
  errorHandler: callbackErrorHandler,
18223
18111
  loadingContext: "",
@@ -18239,8 +18127,7 @@ class IFrameWidget {
18239
18127
  ...httpOptions,
18240
18128
  path: redirectUrl.href
18241
18129
  });
18242
- if (isVerifiedAccountsData(responseData))
18243
- return responseData;
18130
+ if (isVerifiedAccountsData(responseData)) return responseData;
18244
18131
  throw responseData;
18245
18132
  } catch (reason) {
18246
18133
  throw new AdyenKycSdkError("WIDGET_ACCOUNT_COMMIT_FAILURE", reason);
@@ -18299,8 +18186,7 @@ class IFrameWidget {
18299
18186
  reject(new AdyenKycSdkError("WIDGET_TIMEOUT"));
18300
18187
  }, MOUNT_TIMEOUT);
18301
18188
  const cancelTimeout = () => {
18302
- if (timeoutId)
18303
- clearTimeout(timeoutId);
18189
+ if (timeoutId) clearTimeout(timeoutId);
18304
18190
  };
18305
18191
  this.iframeElement.addEventListener("load", () => {
18306
18192
  cancelTimeout();
@@ -18472,8 +18358,6 @@ const useInstantVerificationErrorNotification = (notificationVisibilityDuration)
18472
18358
  useEffect(() => {
18473
18359
  clearNotificationTimeout();
18474
18360
  if (errorNotification) {
18475
- if (notificationVisibilityDuration <= 0)
18476
- return;
18477
18361
  dismissNotificationTimeoutRef.current = setTimeout(() => {
18478
18362
  setErrorNotification(null);
18479
18363
  clearNotificationTimeout();
@@ -18539,8 +18423,7 @@ function InstantBankVerification({
18539
18423
  content: errorContent
18540
18424
  });
18541
18425
  }
18542
- if (onBack)
18543
- onBack();
18426
+ if (onBack) onBack();
18544
18427
  break;
18545
18428
  }
18546
18429
  case "retry_verification":
@@ -18548,8 +18431,7 @@ function InstantBankVerification({
18548
18431
  title: i18n.get("failedInitializeInstantVerification"),
18549
18432
  content: errorContent
18550
18433
  });
18551
- if (onBack)
18552
- onBack();
18434
+ if (onBack) onBack();
18553
18435
  break;
18554
18436
  default: {
18555
18437
  const {
@@ -19322,8 +19204,7 @@ const customPrefixByCountry = {
19322
19204
  [CountryCodes.IsleOfMan]: "GB"
19323
19205
  };
19324
19206
  function ibanValidator(input, bankCountry2) {
19325
- if (isEmpty(input))
19326
- return false;
19207
+ if (isEmpty(input)) return false;
19327
19208
  const ibanInput = input.replace(/ /g, "").toUpperCase();
19328
19209
  if (!/^([a-zA-Z0-9]{4} ){2,8}[a-zA-Z0-9]{1,4}|[a-zA-Z0-9]{12,34}$/.test(ibanInput)) {
19329
19210
  return false;
@@ -19893,11 +19774,9 @@ const getMustHaveSameAccountHolderNameText = (legalEntityType, accountHolderName
19893
19774
  }
19894
19775
  };
19895
19776
  const getInstantVerificationProvider = (bankVerificationProviders, bankCountry2) => {
19896
- if (!bankVerificationProviders)
19897
- return "loading";
19777
+ if (!bankVerificationProviders) return "loading";
19898
19778
  const providerForCountry = bankVerificationProviders[bankCountry2];
19899
- if (!providerForCountry)
19900
- return void 0;
19779
+ if (!providerForCountry) return void 0;
19901
19780
  return providerForCountry.toLowerCase();
19902
19781
  };
19903
19782
  function PayoutVerificationMethod(props) {
@@ -20631,8 +20510,7 @@ const PER_COUNTRY_DECISION_MAKER_REQUIREMENTS_OVERRIDES = {
20631
20510
  }]
20632
20511
  };
20633
20512
  const getDecisionMakerRequirements = (country2) => {
20634
- if (!country2)
20635
- return DEFAULT_DECISION_MAKER_REQUIREMENTS;
20513
+ if (!country2) return DEFAULT_DECISION_MAKER_REQUIREMENTS;
20636
20514
  return PER_COUNTRY_DECISION_MAKER_REQUIREMENTS_OVERRIDES[country2] ?? DEFAULT_DECISION_MAKER_REQUIREMENTS;
20637
20515
  };
20638
20516
  function getAvailableDecisionMakerRoleTypes(country2) {
@@ -20662,8 +20540,7 @@ const getDecisionMakerDescriptionMap = (country2) => ({
20662
20540
  ...PER_COUNTRY_DESCRIPTION_OVERRIDES[country2]
20663
20541
  });
20664
20542
  const getOwnDecisionMakers = (rootLegalEntity) => {
20665
- if (!(rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations))
20666
- return [];
20543
+ if (!(rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations)) return [];
20667
20544
  return rootLegalEntity.entityAssociations.filter((entityAssociation) => Object.values(DecisionMakerType).includes(entityAssociation.type) && entityAssociation.associatorId === rootLegalEntity.id);
20668
20545
  };
20669
20546
  const getDecisionMakers = (rootLegalEntity, companyLegalEntityId) => getDirectEntityAssociations(rootLegalEntity, companyLegalEntityId).filter((association2) => Object.values(DecisionMakerType).includes(association2.type));
@@ -20720,8 +20597,7 @@ const isPartOfTrustFromLegalEntity = (legalEntity) => {
20720
20597
  };
20721
20598
  const getOwnTrustMembersLegalEntityIds = (rootLegalEntity) => {
20722
20599
  const trustLegalEntityId = getOwnTrustLegalEntityId(rootLegalEntity);
20723
- if (!trustLegalEntityId)
20724
- return [];
20600
+ if (!trustLegalEntityId) return [];
20725
20601
  const trustMemberAssociations = getDirectEntityAssociations(rootLegalEntity, trustLegalEntityId);
20726
20602
  const trustMemberIds = trustMemberAssociations.map((association2) => association2.legalEntityId).filter((id2) => id2 !== void 0);
20727
20603
  return [...trustMemberIds, ...trustMemberIds.flatMap((trustMemberId) => getTrustMemberCompanyDecisionMakerIds(rootLegalEntity, trustMemberId))];
@@ -20895,8 +20771,7 @@ function TrustRegistrationDetailsComponent(props) {
20895
20771
  classNameModifiers: ["country"],
20896
20772
  handleChangeFor: () => (e) => {
20897
20773
  handleChangeFor("country", "input")(e);
20898
- if (onCountryChange)
20899
- onCountryChange(e);
20774
+ if (onCountryChange) onCountryChange(e);
20900
20775
  }
20901
20776
  }), formUtils.isRequiredField("legalName") && jsx(Field, {
20902
20777
  name: "legalName",
@@ -21913,8 +21788,7 @@ const getOpeningStep = (forms2, remediationActions) => {
21913
21788
  var _a2;
21914
21789
  return (form2 == null ? void 0 : form2.formId) === ((_a2 = allRemediationActions[0]) == null ? void 0 : _a2.forms[0]);
21915
21790
  });
21916
- if (form)
21917
- return form;
21791
+ if (form) return form;
21918
21792
  }
21919
21793
  return forms2[forms2.length - 1];
21920
21794
  }
@@ -21945,8 +21819,7 @@ const useFormComposer = ({
21945
21819
  }) => formId === activeForm2.formId) ?? activeForm2);
21946
21820
  }, [forms2]);
21947
21821
  useEffect(() => {
21948
- if (hasAlreadyNavigatedForm)
21949
- return;
21822
+ if (hasAlreadyNavigatedForm) return;
21950
21823
  const openingStep = getOpeningStep(forms2, problems == null ? void 0 : problems.remediationActions);
21951
21824
  if (activeForm !== openingStep) {
21952
21825
  setActiveForm(openingStep);
@@ -22121,14 +21994,12 @@ const useScenarioConfiguration = ({
22121
21994
  }, [getConfigurationData, setLoadingStatus]);
22122
21995
  useEffect(() => {
22123
21996
  setLoadingStatus("loading");
22124
- if (!getPayoutAccountFormatData)
22125
- return;
21997
+ if (!getPayoutAccountFormatData) return;
22126
21998
  const makePayoutFormatCallAndSave = async () => {
22127
21999
  try {
22128
22000
  const response = await getPayoutAccountFormatData();
22129
22001
  setAccountFormatResponse(response);
22130
- if (!response)
22131
- return;
22002
+ if (!response) return;
22132
22003
  const allowedBankAccountFormats = Object.keys(response);
22133
22004
  if (existingBankAccountFormat && !allowedBankAccountFormats.includes(existingBankAccountFormat)) {
22134
22005
  throw new AdyenKycSdkError(`Account format, ${existingBankAccountFormat}, of transferInstrument is not in allowed formats for ${country2}`);
@@ -22148,8 +22019,7 @@ const useScenarioConfiguration = ({
22148
22019
  bankVerificationVendors,
22149
22020
  requiredFields
22150
22021
  } = useMemo(() => {
22151
- if (!configurationResponse)
22152
- return {};
22022
+ if (!configurationResponse) return {};
22153
22023
  const {
22154
22024
  matchingScenario,
22155
22025
  bankVerificationProviders
@@ -22445,8 +22315,7 @@ function parsePayoutScenarios({
22445
22315
  country: country2,
22446
22316
  bankVerificationAvailable
22447
22317
  }) {
22448
- if (!requiredFields)
22449
- return;
22318
+ if (!requiredFields) return;
22450
22319
  const fieldConfigurations = {};
22451
22320
  fieldConfigurations.payoutVerificationMethod = {
22452
22321
  rule: "REQUIRED"
@@ -22744,8 +22613,7 @@ const getFieldsWithExistingData = (legalEntity, isExperimentEnabled) => {
22744
22613
  var _a;
22745
22614
  const apiFieldsWithExistingData = getNestedPropertyKeys(legalEntity);
22746
22615
  const legalEntityType = legalEntity.type;
22747
- if (!legalEntityType)
22748
- return [];
22616
+ if (!legalEntityType) return [];
22749
22617
  const nonDocumentFields = apiFieldsWithExistingData.map((field) => convertApiFieldNameToSchemaFieldName(field, legalEntityType, isExperimentEnabled)).filter((field) => field !== void 0).filter((field) => !knownProblematicFields.includes(field));
22750
22618
  if ((_a = legalEntity.documentDetails) == null ? void 0 : _a.length) {
22751
22619
  const documentFields = legalEntity.documentDetails.map((document2) => legalEntityDocumentToFieldMapping[legalEntityType][document2.type]).filter((field) => field !== void 0);
@@ -22878,23 +22746,35 @@ const mapLegalArrangementOptionToCompanyTypesValue = (legalArrangement) => {
22878
22746
  case "associationIncorporated":
22879
22747
  return CompanyTypesValue.INCORPORATED_ASSOCIATION;
22880
22748
  default:
22749
+ return void 0;
22750
+ }
22751
+ };
22752
+ const determineOrganizationTypeToUpdate = (defaultLegalArrangement, targetLegalArrangement, currentCompanyTypeValue) => {
22753
+ if (targetLegalArrangement === "aTrust") {
22754
+ return;
22755
+ }
22756
+ if (!targetLegalArrangement) {
22757
+ const isUnavailableTypesInCompany = currentCompanyTypeValue === CompanyTypesValue.INCORPORATED_ASSOCIATION || currentCompanyTypeValue === CompanyTypesValue.INCORPORATED_PARTNERSHIP;
22758
+ if (isUnavailableTypesInCompany) {
22881
22759
  return "";
22760
+ }
22882
22761
  }
22762
+ return mapLegalArrangementOptionToCompanyTypesValue(targetLegalArrangement);
22883
22763
  };
22884
22764
  const getDefaultLegalArrangementOrSuborganizationType = (legalEntityResponse, accountHolder2) => {
22885
22765
  var _a;
22886
22766
  const entityAssociations = legalEntityResponse == null ? void 0 : legalEntityResponse.entityAssociations;
22887
22767
  const suborganizationType = (_a = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _a.type;
22768
+ const hasTrust = hasOwnEntityAssociationOfType(LegalEntityType.TRUST, entityAssociations, legalEntityResponse == null ? void 0 : legalEntityResponse.id);
22769
+ if (hasTrust || accountHolder2 === "aTrust") {
22770
+ return "aTrust";
22771
+ }
22888
22772
  if (suborganizationType === CompanyTypesValue.INCORPORATED_PARTNERSHIP) {
22889
22773
  return "partnershipIncorporated";
22890
22774
  }
22891
22775
  if (suborganizationType === CompanyTypesValue.INCORPORATED_ASSOCIATION) {
22892
22776
  return "associationIncorporated";
22893
22777
  }
22894
- const hasTrust = hasOwnEntityAssociationOfType(LegalEntityType.TRUST, entityAssociations, legalEntityResponse == null ? void 0 : legalEntityResponse.id);
22895
- if (hasTrust || accountHolder2 === "aTrust") {
22896
- return "aTrust";
22897
- }
22898
22778
  return void 0;
22899
22779
  };
22900
22780
  const getTargetLegalEntityType = (businessType, legalArrangement, trusteeType, currentLegalEntityType) => {
@@ -22904,11 +22784,12 @@ const getTargetLegalEntityType = (businessType, legalArrangement, trusteeType, c
22904
22784
  if (businessType === "legalArrangement" && legalArrangement === "aTrust" && trusteeType === "individual" || businessType === "individual" || businessType === "soleProprietorship") {
22905
22785
  return LegalEntityType.INDIVIDUAL;
22906
22786
  }
22907
- if (legalArrangement === "partnershipIncorporated") {
22787
+ if (legalArrangement && isLegalArrangementOrganizationSubtype(legalArrangement)) {
22908
22788
  return LegalEntityType.ORGANIZATION;
22909
22789
  }
22910
22790
  return currentLegalEntityType;
22911
22791
  };
22792
+ const isLegalArrangementOrganizationSubtype = (legalArrangementOption) => legalArrangementOption === "partnershipIncorporated" || legalArrangementOption === "associationIncorporated";
22912
22793
  var ToastType = /* @__PURE__ */ ((ToastType2) => {
22913
22794
  ToastType2["LOADING"] = "loading";
22914
22795
  ToastType2["SUCCESS"] = "success";
@@ -23008,8 +22889,7 @@ function FormNavigation({
23008
22889
  } = useI18nContext();
23009
22890
  const getFormIndex = (form) => forms2.findIndex((f) => f.formId === form.formId);
23010
22891
  const goToForm = (form) => () => {
23011
- if (form.formId === activeForm.formId)
23012
- return;
22892
+ if (form.formId === activeForm.formId) return;
23013
22893
  gotoForm(getFormIndex(form));
23014
22894
  trackNavigation2({
23015
22895
  fromForm: form,
@@ -23218,7 +23098,8 @@ function CompanyDropinComponent({
23218
23098
  handleUpdateLegalEntity,
23219
23099
  handleHomeClick,
23220
23100
  onTypeSwitch,
23221
- onChange
23101
+ onChange,
23102
+ accountHolder: accountHolder2
23222
23103
  }) {
23223
23104
  var _a, _b;
23224
23105
  const {
@@ -23235,7 +23116,8 @@ function CompanyDropinComponent({
23235
23116
  i18n,
23236
23117
  setLocale
23237
23118
  } = useI18nContext();
23238
- const dataFromResponse = mapLegalEntityToCompany(legalEntityResponse, isTargetLegalEntityType);
23119
+ const isNewEntryFlowEnabled = useEnableNewEntryFlow();
23120
+ const dataFromResponse = mapLegalEntityToCompany(legalEntityResponse, isTargetLegalEntityType, isNewEntryFlowEnabled ? accountHolder2 : void 0);
23239
23121
  const {
23240
23122
  getConfiguration: getConfiguration2
23241
23123
  } = useConfigurationApi();
@@ -23291,7 +23173,7 @@ function CompanyDropinComponent({
23291
23173
  });
23292
23174
  onChange == null ? void 0 : onChange(currentState);
23293
23175
  }, [currentState]);
23294
- const isSkippingCompanyStructure = useEnableNewEntryFlow() && organizationTypesToSkipCompanyStructureForm.includes((_b = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _b.type);
23176
+ const isSkippingCompanyStructure = useEnableNewEntryFlow() && organizationTypesToSkipCompanyStructureForm.includes((_b = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _b.type) && accountHolder2 !== "aTrust";
23295
23177
  const forms2 = useMemo(() => {
23296
23178
  const requiredForms = getRequiredForms(companyForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
23297
23179
  const validityAddedForms = addValidityToForms(requiredForms, formValidity, problems);
@@ -23302,8 +23184,7 @@ function CompanyDropinComponent({
23302
23184
  legalEntity,
23303
23185
  dataSubmitted
23304
23186
  }) => {
23305
- if (!isDocumentsRequired$2(forms22))
23306
- return;
23187
+ if (!isDocumentsRequired$2(forms22)) return;
23307
23188
  const formattedDocument = await mapCompanyDocumentToApiDocument(dataSubmitted, legalEntity.id);
23308
23189
  if (formattedDocument) {
23309
23190
  await documentUtils.uploadDocuments(formattedDocument, legalEntity.id);
@@ -23583,8 +23464,7 @@ function useCompanySearch({
23583
23464
  deepSearch
23584
23465
  }) => {
23585
23466
  try {
23586
- if (!deepSearch)
23587
- return;
23467
+ if (!deepSearch) return;
23588
23468
  setStatus("loading");
23589
23469
  setCompaniesList([]);
23590
23470
  const {
@@ -23608,8 +23488,7 @@ function useCompanySearch({
23608
23488
  return setStatus("idle");
23609
23489
  }
23610
23490
  try {
23611
- if (!handleCompanyDeepSearch)
23612
- return;
23491
+ if (!handleCompanyDeepSearch) return;
23613
23492
  setStatus("loading");
23614
23493
  setSelectedCompanyId(void 0);
23615
23494
  const {
@@ -23630,8 +23509,7 @@ function useCompanySearch({
23630
23509
  }, [handleCompanyDeepSearch, country2, legalCompanyName2, limit, stateOrProvince2]);
23631
23510
  const verify2 = useCallback(async (companyTIN, company2) => {
23632
23511
  try {
23633
- if (!handleVerifyTin || !handleGetCompanyDataset || !handleRefreshCompanyDataset)
23634
- return;
23512
+ if (!handleVerifyTin || !handleGetCompanyDataset || !handleRefreshCompanyDataset) return;
23635
23513
  setStatus("loading");
23636
23514
  setSelectedCompanyId(company2.id);
23637
23515
  if (!canVerify || !companyTIN) {
@@ -23797,10 +23675,8 @@ const CompanyLookupResultsHeader = ({
23797
23675
  if (status === "loading") {
23798
23676
  return selectedCompanyId ? i18n.get("companyLookupResultsHeader__verifying") : i18n.get("companyLookupResultsHeader__searching");
23799
23677
  }
23800
- if (numberOfResults === 0 && status === "loaded")
23801
- return i18n.get("companyLookupResultsHeader__noResults");
23802
- if (numberOfResults)
23803
- return i18n.get("companyLookupResultsHeader__results");
23678
+ if (numberOfResults === 0 && status === "loaded") return i18n.get("companyLookupResultsHeader__noResults");
23679
+ if (numberOfResults) return i18n.get("companyLookupResultsHeader__results");
23804
23680
  return i18n.get("companyLookupResultsHeader");
23805
23681
  }, [hasInternalError, status, numberOfResults, i18n, selectedCompanyId]);
23806
23682
  const descriptionText = useMemo(() => {
@@ -24201,8 +24077,7 @@ function TaxInformationField({
24201
24077
  type: countryToTaxInfoTypeMap[country2]
24202
24078
  }];
24203
24079
  const updatedTaxInformation = taxInformation.map((taxInfo) => {
24204
- if (taxInfo.country !== country2)
24205
- return taxInfo;
24080
+ if (taxInfo.country !== country2) return taxInfo;
24206
24081
  return {
24207
24082
  country: country2,
24208
24083
  number: value,
@@ -24229,8 +24104,7 @@ function TaxInformationField({
24229
24104
  type: countryToTaxInfoTypeMap[country2]
24230
24105
  }];
24231
24106
  const updatedTaxInformation = taxInformation.map((taxInfo) => {
24232
- if (taxInfo.country !== country2)
24233
- return taxInfo;
24107
+ if (taxInfo.country !== country2) return taxInfo;
24234
24108
  return {
24235
24109
  country: country2,
24236
24110
  number: value,
@@ -24311,8 +24185,7 @@ const defaultFieldConfig = entriesOf(defaultFieldConfig$7).reduce((fieldConfig,
24311
24185
  errorMessage: (taxInformation) => {
24312
24186
  var _a;
24313
24187
  const taxIdNumber2 = (_a = taxInformation == null ? void 0 : taxInformation.find((taxId2) => country2 === taxId2.country)) == null ? void 0 : _a.number;
24314
- if (!taxIdNumber2)
24315
- return void 0;
24188
+ if (!taxIdNumber2) return void 0;
24316
24189
  return typeof validator.errorMessage === "function" ? validator.errorMessage(taxIdNumber2) : validator.errorMessage;
24317
24190
  }
24318
24191
  }));
@@ -25246,8 +25119,7 @@ const formatDataForSummary = (data, forms2, labels2, i18n) => {
25246
25119
  }, defaultFieldMetadata).label;
25247
25120
  return entriesOf(data).reduce((summaryData, [form, formData]) => {
25248
25121
  var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
25249
- if (!form)
25250
- return summaryData;
25122
+ if (!form) return summaryData;
25251
25123
  switch (form) {
25252
25124
  case "companyBasics":
25253
25125
  return {
@@ -25281,8 +25153,7 @@ const formatDataForSummary = (data, forms2, labels2, i18n) => {
25281
25153
  [form]: formatOtherDetails(formData, i18n, (_f = data.companyBasics) == null ? void 0 : _f.country, labels2)
25282
25154
  };
25283
25155
  case "companyRegistrationDocument":
25284
- if (!isDocumentsRequired$1(forms2))
25285
- return summaryData;
25156
+ if (!isDocumentsRequired$1(forms2)) return summaryData;
25286
25157
  return {
25287
25158
  ...summaryData,
25288
25159
  [form]: {
@@ -25292,8 +25163,7 @@ const formatDataForSummary = (data, forms2, labels2, i18n) => {
25292
25163
  }
25293
25164
  };
25294
25165
  case "companyTaxDocument":
25295
- if (!isDocumentsRequired$1(forms2))
25296
- return summaryData;
25166
+ if (!isDocumentsRequired$1(forms2)) return summaryData;
25297
25167
  return {
25298
25168
  ...summaryData,
25299
25169
  [form]: {
@@ -25536,8 +25406,7 @@ function useCompanySearchTaskSubmit({
25536
25406
  legalEntity,
25537
25407
  currentForms
25538
25408
  }) => {
25539
- if (!isDocumentsRequired$1(currentForms))
25540
- return;
25409
+ if (!isDocumentsRequired$1(currentForms)) return;
25541
25410
  const formattedDocument = await mapCompanySearchDocumentToApiDocument(data, legalEntity.id);
25542
25411
  try {
25543
25412
  if (formattedDocument) {
@@ -25839,8 +25708,7 @@ function CompanySearchDropinComponent({
25839
25708
  var _a2;
25840
25709
  eventEmitter.on("updateLocale", (locale) => setLocale(locale));
25841
25710
  const documentIds = ((_a2 = legalEntityResponse == null ? void 0 : legalEntityResponse.documentDetails) == null ? void 0 : _a2.map((documentReference) => documentReference.id)) || [];
25842
- if (!documentIds.length)
25843
- return;
25711
+ if (!documentIds.length) return;
25844
25712
  documentUtils.fetchDocuments(documentIds, legalEntityResponse.id).then(() => {
25845
25713
  setInitialData({
25846
25714
  ...initialData,
@@ -25999,8 +25867,7 @@ const useLocalStorage = (key, defaultValue, options) => {
25999
25867
  }), [options]);
26000
25868
  const rawValueRef = useRef(null);
26001
25869
  const [value, setValue] = useState(() => {
26002
- if (typeof window === "undefined")
26003
- return defaultValue;
25870
+ if (typeof window === "undefined") return defaultValue;
26004
25871
  try {
26005
25872
  rawValueRef.current = window.localStorage.getItem(key);
26006
25873
  const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
@@ -26011,8 +25878,7 @@ const useLocalStorage = (key, defaultValue, options) => {
26011
25878
  }
26012
25879
  });
26013
25880
  useEffect(() => {
26014
- if (typeof window === "undefined")
26015
- return;
25881
+ if (typeof window === "undefined") return;
26016
25882
  const updateLocalStorage = () => {
26017
25883
  if (value !== void 0) {
26018
25884
  const newValue = serializer(value);
@@ -26042,11 +25908,9 @@ const useLocalStorage = (key, defaultValue, options) => {
26042
25908
  }
26043
25909
  }, [value]);
26044
25910
  useEffect(() => {
26045
- if (!syncData)
26046
- return;
25911
+ if (!syncData) return;
26047
25912
  const handleStorageChange = (event) => {
26048
- if (event.key !== key || event.storageArea !== window.localStorage)
26049
- return;
25913
+ if (event.key !== key || event.storageArea !== window.localStorage) return;
26050
25914
  try {
26051
25915
  if (event.newValue !== rawValueRef.current) {
26052
25916
  rawValueRef.current = event.newValue;
@@ -26056,8 +25920,7 @@ const useLocalStorage = (key, defaultValue, options) => {
26056
25920
  logger$f.error(err);
26057
25921
  }
26058
25922
  };
26059
- if (typeof window === "undefined")
26060
- return;
25923
+ if (typeof window === "undefined") return;
26061
25924
  window.addEventListener("storage", handleStorageChange);
26062
25925
  return () => window.removeEventListener("storage", handleStorageChange);
26063
25926
  }, [key, syncData]);
@@ -26091,11 +25954,9 @@ const useIsEligibleForSingpass = ({
26091
25954
  const {
26092
25955
  isExperimentEnabled
26093
25956
  } = useExperimentsContext();
26094
- if (!isExperimentEnabled("ShowSingPassButtonForCompanies"))
26095
- return false;
25957
+ if (!isExperimentEnabled("ShowSingPassButtonForCompanies")) return false;
26096
25958
  const isSingpassEnabled = Boolean(handleOpenSingpassAuthorizationLink) && getLegalEntityCountry(legalEntity) === CountryCodes.Singapore;
26097
- if (!isSingpassEnabled)
26098
- return false;
25959
+ if (!isSingpassEnabled) return false;
26099
25960
  if (accountHolder2) {
26100
25961
  return accountHolder2 === "theCompanyIWorkFor";
26101
25962
  }
@@ -26138,8 +25999,7 @@ const useExemptSettlor = ({
26138
25999
  setExemptSettlor(exemptSettlorLE);
26139
26000
  }, [handleGetLegalEntity]);
26140
26001
  useEffect(() => {
26141
- if (!(trust2 == null ? void 0 : trust2.trust))
26142
- return;
26002
+ if (!(trust2 == null ? void 0 : trust2.trust)) return;
26143
26003
  updateExemptSettlor(trust2).catch(logger$d.error);
26144
26004
  }, [trust2, updateExemptSettlor]);
26145
26005
  return exemptSettlor;
@@ -26200,8 +26060,7 @@ const saveBlobAsFile = (fileData, filename) => {
26200
26060
  const isNewEntity = Symbol("isNewEntity");
26201
26061
  const splitAtFirstOccurrence = (str, separator) => {
26202
26062
  const firstOccurrence = str.indexOf(separator);
26203
- if (firstOccurrence === -1)
26204
- return [str];
26063
+ if (firstOccurrence === -1) return [str];
26205
26064
  return [str.slice(0, firstOccurrence), str.slice(firstOccurrence + 1)];
26206
26065
  };
26207
26066
  const getTrustMemberOwnerId = (trustMemberId, entityAssociations) => {
@@ -26228,23 +26087,21 @@ const convertEntityAssociationIntoTrustMember = (association2, associations, exe
26228
26087
  name: association2.name
26229
26088
  };
26230
26089
  }
26231
- if (association2.entityType === LegalEntityType.ORGANIZATION)
26232
- return {
26233
- trustMemberType: "company",
26234
- roles: [],
26235
- legalEntityType: LegalEntityType.ORGANIZATION,
26236
- legalEntityId: association2.legalEntityId,
26237
- name: association2.name,
26238
- ownerId: getTrustMemberOwnerId(association2.legalEntityId, associations)
26239
- };
26240
- if (association2.entityType === LegalEntityType.INDIVIDUAL)
26241
- return {
26242
- trustMemberType: "regular",
26243
- roles: [],
26244
- legalEntityType: LegalEntityType.INDIVIDUAL,
26245
- legalEntityId: association2.legalEntityId,
26246
- name: association2.name
26247
- };
26090
+ if (association2.entityType === LegalEntityType.ORGANIZATION) return {
26091
+ trustMemberType: "company",
26092
+ roles: [],
26093
+ legalEntityType: LegalEntityType.ORGANIZATION,
26094
+ legalEntityId: association2.legalEntityId,
26095
+ name: association2.name,
26096
+ ownerId: getTrustMemberOwnerId(association2.legalEntityId, associations)
26097
+ };
26098
+ if (association2.entityType === LegalEntityType.INDIVIDUAL) return {
26099
+ trustMemberType: "regular",
26100
+ roles: [],
26101
+ legalEntityType: LegalEntityType.INDIVIDUAL,
26102
+ legalEntityId: association2.legalEntityId,
26103
+ name: association2.name
26104
+ };
26248
26105
  throw new Error(`Not a valid trust member: ${JSON.stringify(association2)}`);
26249
26106
  };
26250
26107
  const mapEntityAssociationsToTrustMembers = (trustEntityId, entityAssociations, exemptSettlorLE) => {
@@ -26304,14 +26161,13 @@ const mapTrustMemberToEntityAssociations = (trustMember) => {
26304
26161
  if (trustMember.legalEntityId === isNewEntity) {
26305
26162
  throw Error("Cannot map a new trust member, you must create it first");
26306
26163
  }
26307
- if (trustMember.trustMemberType === "exemptSettlor")
26308
- return [{
26309
- legalEntityId: trustMember.legalEntityId,
26310
- entityType: trustMember.legalEntityType,
26311
- type: TrustMemberTypes.SETTLOR,
26312
- settlorExemptionReason: trustMember.settlorExemptionReason,
26313
- name: trustMember.legalEntityType === LegalEntityType.INDIVIDUAL ? `${(_a = trustMember.exemptSettlorName) == null ? void 0 : _a.firstName} ${(_b = trustMember.exemptSettlorName) == null ? void 0 : _b.lastName}` : trustMember.name ?? ""
26314
- }];
26164
+ if (trustMember.trustMemberType === "exemptSettlor") return [{
26165
+ legalEntityId: trustMember.legalEntityId,
26166
+ entityType: trustMember.legalEntityType,
26167
+ type: TrustMemberTypes.SETTLOR,
26168
+ settlorExemptionReason: trustMember.settlorExemptionReason,
26169
+ name: trustMember.legalEntityType === LegalEntityType.INDIVIDUAL ? `${(_a = trustMember.exemptSettlorName) == null ? void 0 : _a.firstName} ${(_b = trustMember.exemptSettlorName) == null ? void 0 : _b.lastName}` : trustMember.name ?? ""
26170
+ }];
26315
26171
  return trustMember.roles.map((role2) => ({
26316
26172
  legalEntityId: trustMember.legalEntityId,
26317
26173
  type: role2
@@ -26692,8 +26548,7 @@ const BusinessTypeSelection = ({
26692
26548
  }, []);
26693
26549
  const handleNextClick = async () => {
26694
26550
  var _a2;
26695
- if (loadingStatus === "loading")
26696
- return;
26551
+ if (loadingStatus === "loading") return;
26697
26552
  triggerValidation();
26698
26553
  if (isValid) {
26699
26554
  if (((_a2 = data.businessType) == null ? void 0 : _a2.id) === "legalArrangement") {
@@ -26743,18 +26598,15 @@ const BusinessTypeSelection = ({
26743
26598
  type: targetLegalEntityType
26744
26599
  };
26745
26600
  await (handleUpdateLegalEntity == null ? void 0 : handleUpdateLegalEntity(updateLegalEntityPayload, legalEntityResponse == null ? void 0 : legalEntityResponse.id));
26746
- if (targetLegalEntityType === LegalEntityType.ORGANIZATION && targetLegalEntityType) {
26747
- await (handleUpdateLegalEntity == null ? void 0 : handleUpdateLegalEntity({
26748
- organization: {
26749
- type: mapLegalArrangementOptionToCompanyTypesValue(targetLegalArrangement)
26750
- }
26751
- }, legalEntityResponse == null ? void 0 : legalEntityResponse.id));
26752
- }
26753
26601
  }
26754
- if (isLegalArrangementChanging && targetLegalArrangement) {
26602
+ if (targetLegalEntityType === LegalEntityType.INDIVIDUAL) {
26603
+ return;
26604
+ }
26605
+ const targetOrganizationType = determineOrganizationTypeToUpdate(defaultLegalArrangementType == null ? void 0 : defaultLegalArrangementType.id, targetLegalArrangement, currentCompanyTypesValue);
26606
+ if (targetOrganizationType !== void 0) {
26755
26607
  await (handleUpdateLegalEntity == null ? void 0 : handleUpdateLegalEntity({
26756
26608
  organization: {
26757
- type: mapLegalArrangementOptionToCompanyTypesValue(targetLegalArrangement)
26609
+ type: targetOrganizationType
26758
26610
  }
26759
26611
  }, legalEntityResponse == null ? void 0 : legalEntityResponse.id));
26760
26612
  }
@@ -27709,12 +27561,9 @@ const useLegalEntityType = ({
27709
27561
  switch (legalEntity.type) {
27710
27562
  case LegalEntityType.INDIVIDUAL:
27711
27563
  case LegalEntityType.ORGANIZATION:
27712
- if (!hasLegalAssociation)
27713
- return legalEntity.type;
27714
- if (isSoleProprietor)
27715
- return LegalEntityType.SOLE_PROPRIETORSHIP;
27716
- if (isTrust)
27717
- return LegalEntityType.TRUST;
27564
+ if (!hasLegalAssociation) return legalEntity.type;
27565
+ if (isSoleProprietor) return LegalEntityType.SOLE_PROPRIETORSHIP;
27566
+ if (isTrust) return LegalEntityType.TRUST;
27718
27567
  break;
27719
27568
  default:
27720
27569
  return void 0;
@@ -27759,12 +27608,9 @@ const useIntroductionScreens = ({
27759
27608
  const isSoleProprietor = legalEntityType === LegalEntityType.SOLE_PROPRIETORSHIP;
27760
27609
  const isTrustScreen = screen === IntroductionScreens.TRUST || screen === IntroductionScreens.TRUST_MEMBER_OVERVIEW;
27761
27610
  const isTrust = legalEntityType === LegalEntityType.TRUST;
27762
- if (isAccountScreen)
27763
- return hasAccountTask;
27764
- if (isSoleProprietorScreen)
27765
- return isSoleProprietor;
27766
- if (isTrustScreen)
27767
- return isTrust;
27611
+ if (isAccountScreen) return hasAccountTask;
27612
+ if (isSoleProprietorScreen) return isSoleProprietor;
27613
+ if (isTrustScreen) return isTrust;
27768
27614
  return tasks.some((task) => screen === task);
27769
27615
  }) : [], [legalEntityType, tasks]);
27770
27616
  return canSeeIntroduction && (introductionScreens == null ? void 0 : introductionScreens.length) > 0 ? [IntroductionScreens.PROLOGUE, ...introductionScreens, IntroductionScreens.EPILOGUE] : void 0;
@@ -29214,8 +29060,7 @@ function IndividualDropinComponent({
29214
29060
  dataSubmitted
29215
29061
  }) => {
29216
29062
  var _a2;
29217
- if (!isDocumentsRequired2(forms22))
29218
- return;
29063
+ if (!isDocumentsRequired2(forms22)) return;
29219
29064
  if ((_a2 = dataSubmitted.idDocument) == null ? void 0 : _a2.instantIdVerificationData) {
29220
29065
  await handleInstantIdVerificationStartCheck(dataSubmitted.idDocument.instantIdVerificationData, legalEntity.id);
29221
29066
  } else {
@@ -29351,20 +29196,17 @@ function IndividualDropinComponent({
29351
29196
  const datasetUtils = datasetUtilities(i18n.locale);
29352
29197
  const formatIdDocument = (idDocument2) => {
29353
29198
  var _a2, _b2;
29354
- if (!idDocument2)
29355
- return void 0;
29199
+ if (!idDocument2) return void 0;
29356
29200
  const documentType2 = (idDocument2 == null ? void 0 : idDocument2.instantIdVerificationData) ? onfidoDocumentTypeMapping.find((document2) => {
29357
29201
  var _a3;
29358
29202
  return ((_a3 = idDocument2.instantIdVerificationData) == null ? void 0 : _a3.document_front.type) === document2.id;
29359
29203
  }) : idDocumentTypeOptions.find(({
29360
29204
  id: id2
29361
29205
  }) => idDocument2.idDocumentType === id2);
29362
- if (!documentType2)
29363
- return void 0;
29206
+ if (!documentType2) return void 0;
29364
29207
  const frontPage2 = (_a2 = idDocument2.idFrontPage) == null ? void 0 : _a2[0];
29365
29208
  const backPage2 = (_b2 = idDocument2.idBackPage) == null ? void 0 : _b2[0];
29366
- if (!frontPage2)
29367
- return void 0;
29209
+ if (!frontPage2) return void 0;
29368
29210
  return {
29369
29211
  documentType: i18n.get(documentType2.name),
29370
29212
  ...backPage2 && documentType2.hasBackPage ? {
@@ -29548,8 +29390,7 @@ const rules$1 = ({
29548
29390
  }) => ({
29549
29391
  whenUsingManualVerification: () => {
29550
29392
  var _a;
29551
- if (!data.payoutVerificationMethod)
29552
- return;
29393
+ if (!data.payoutVerificationMethod) return;
29553
29394
  if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
29554
29395
  return "REQUIRED";
29555
29396
  }
@@ -29813,8 +29654,7 @@ function PayoutDetailsDropinComponent({
29813
29654
  useEffect(() => {
29814
29655
  var _a2;
29815
29656
  const payoutAccountData = (_a2 = cloneObject(data)) == null ? void 0 : _a2.payoutAccountDetails;
29816
- if (payoutAccountData)
29817
- setAccountDetailsFromInput(payoutAccountData);
29657
+ if (payoutAccountData) setAccountDetailsFromInput(payoutAccountData);
29818
29658
  }, [data]);
29819
29659
  const onSubmit = async () => {
29820
29660
  setLoadingStatus("loading");
@@ -30103,8 +29943,7 @@ function PciDropinComponent({
30103
29943
  name: `${(_a = legalEntityResponse == null ? void 0 : legalEntityResponse.individual) == null ? void 0 : _a.name.firstName} ${(_b = legalEntityResponse.individual) == null ? void 0 : _b.name.lastName}`
30104
29944
  }];
30105
29945
  const handleSignClick = async () => {
30106
- if (loadingStatus === "loading")
30107
- return;
29946
+ if (loadingStatus === "loading") return;
30108
29947
  userEvents.addEvent("Clicked PCI signing", {
30109
29948
  segmentation: {
30110
29949
  ...baseTrackingPayload
@@ -30236,8 +30075,7 @@ function PciDropinComponent({
30236
30075
  });
30237
30076
  }
30238
30077
  const convertExistingSettlorExemptionReasons = (existingReasons) => {
30239
- if (!existingReasons || !existingReasons.length)
30240
- return ["noneOfTheAbove"];
30078
+ if (!existingReasons || !existingReasons.length) return ["noneOfTheAbove"];
30241
30079
  return existingReasons;
30242
30080
  };
30243
30081
  const convertExistingTrustMember = (trustMember) => {
@@ -30352,8 +30190,7 @@ const getAvailableRolesByTrustMemberTypeAndLegalEntityType = (currentRoles, trus
30352
30190
  return roles.filter((r) => r !== "secondaryTrustee");
30353
30191
  };
30354
30192
  const getAvailableRoles = (currentRoles) => {
30355
- if (!(currentRoles == null ? void 0 : currentRoles.length))
30356
- return Object.values(TrustMemberTypes);
30193
+ if (!(currentRoles == null ? void 0 : currentRoles.length)) return Object.values(TrustMemberTypes);
30357
30194
  return currentRoles.map((role2) => [role2, ...allowedCrossoverRolesMatrix[role2]]).reduce((existingAllowed, allowedForRole) => existingAllowed.filter((role2) => allowedForRole.includes(role2)));
30358
30195
  };
30359
30196
  const trustMemberLegalEntityTypes = [LegalEntityType.INDIVIDUAL, LegalEntityType.ORGANIZATION];
@@ -30690,8 +30527,7 @@ const exemptSettlorForms = {
30690
30527
  summary
30691
30528
  };
30692
30529
  const decideForms = (trustMember) => {
30693
- if (trustMember === "incomplete")
30694
- return regularForms;
30530
+ if (trustMember === "incomplete") return regularForms;
30695
30531
  switch (trustMember.trustMemberType) {
30696
30532
  case "undefinedBeneficiary":
30697
30533
  return undefinedBeneficiaryForms;
@@ -30741,13 +30577,12 @@ const convertDataToTrustMember = (data, existingTrustMember, isOrganizationSettl
30741
30577
  legalEntityId: existingId ?? isNewEntity
30742
30578
  };
30743
30579
  }
30744
- if (data.role.includes("undefinedBeneficiary"))
30745
- return {
30746
- trustMemberType: "undefinedBeneficiary",
30747
- roles: [TrustMemberTypes.UNDEFINED_BENEFICIARY],
30748
- description: data.descriptionUndefinedBeneficiary ?? "",
30749
- reference: existingId ?? isNewEntity
30750
- };
30580
+ if (data.role.includes("undefinedBeneficiary")) return {
30581
+ trustMemberType: "undefinedBeneficiary",
30582
+ roles: [TrustMemberTypes.UNDEFINED_BENEFICIARY],
30583
+ description: data.descriptionUndefinedBeneficiary ?? "",
30584
+ reference: existingId ?? isNewEntity
30585
+ };
30751
30586
  if (data.entityType === LegalEntityType.ORGANIZATION) {
30752
30587
  return {
30753
30588
  trustMemberType: "company",
@@ -30758,14 +30593,13 @@ const convertDataToTrustMember = (data, existingTrustMember, isOrganizationSettl
30758
30593
  country: data.country
30759
30594
  };
30760
30595
  }
30761
- if (data.entityType === LegalEntityType.INDIVIDUAL)
30762
- return {
30763
- trustMemberType: "regular",
30764
- roles: data.role,
30765
- legalEntityType: LegalEntityType.INDIVIDUAL,
30766
- legalEntityId: existingId ?? isNewEntity,
30767
- name: ""
30768
- };
30596
+ if (data.entityType === LegalEntityType.INDIVIDUAL) return {
30597
+ trustMemberType: "regular",
30598
+ roles: data.role,
30599
+ legalEntityType: LegalEntityType.INDIVIDUAL,
30600
+ legalEntityId: existingId ?? isNewEntity,
30601
+ name: ""
30602
+ };
30769
30603
  }
30770
30604
  return "incomplete";
30771
30605
  };
@@ -30825,8 +30659,7 @@ function RoleAndTypeDropinComponent({
30825
30659
  setTrustMember(convertDataToTrustMember(data, existingTrustMember, isOrganizationSettlorWithExemptionEnabled));
30826
30660
  };
30827
30661
  const saveRolesAndNavigate = async () => {
30828
- if (trustMember === "incomplete")
30829
- return;
30662
+ if (trustMember === "incomplete") return;
30830
30663
  if (hasRolesChanged(trustMember.roles, existingTrustMember == null ? void 0 : existingTrustMember.roles)) {
30831
30664
  addOrUpdateTrustMember(trustMember);
30832
30665
  }
@@ -30849,8 +30682,7 @@ function RoleAndTypeDropinComponent({
30849
30682
  navigateToFullDropinFor(trustMember);
30850
30683
  return;
30851
30684
  }
30852
- if (targetForm.formId === summaryStep.formId)
30853
- return;
30685
+ if (targetForm.formId === summaryStep.formId) return;
30854
30686
  }
30855
30687
  setActiveForm(targetForm);
30856
30688
  };
@@ -30924,8 +30756,7 @@ const useServiceAgreement = ({
30924
30756
  }, [language]);
30925
30757
  useEffect(() => {
30926
30758
  const requestAcceptedServiceAgreement = async () => {
30927
- if (!handleViewAcceptedTermsOfServiceDocument || !acceptanceId)
30928
- return;
30759
+ if (!handleViewAcceptedTermsOfServiceDocument || !acceptanceId) return;
30929
30760
  setLoading("loading");
30930
30761
  const {
30931
30762
  id: id2,
@@ -30941,8 +30772,7 @@ const useServiceAgreement = ({
30941
30772
  }, [acceptanceId, handleViewAcceptedTermsOfServiceDocument]);
30942
30773
  useEffect(() => {
30943
30774
  const requestServiceAgreement = async () => {
30944
- if (acceptanceId)
30945
- return;
30775
+ if (acceptanceId) return;
30946
30776
  setLoading("loading");
30947
30777
  try {
30948
30778
  const {
@@ -31078,8 +30908,7 @@ function ServiceAgreementDropinComponent({
31078
30908
  }
31079
30909
  });
31080
30910
  triggerValidation();
31081
- if (loadingStatus === "loading" || !serviceAgreement || !data.signer)
31082
- return;
30911
+ if (loadingStatus === "loading" || !serviceAgreement || !data.signer) return;
31083
30912
  if (isValid) {
31084
30913
  try {
31085
30914
  setLoadingStatus("loading");
@@ -31136,8 +30965,7 @@ function ServiceAgreementDropinComponent({
31136
30965
  });
31137
30966
  };
31138
30967
  useEffect(() => {
31139
- if (!serviceAgreementAcceptanceInfos.length)
31140
- return;
30968
+ if (!serviceAgreementAcceptanceInfos.length) return;
31141
30969
  gotoForm(serviceAgreementAcceptanceInfos.length - 1);
31142
30970
  }, [serviceAgreementAcceptanceInfos]);
31143
30971
  useEffect(() => {
@@ -31156,8 +30984,7 @@ function ServiceAgreementDropinComponent({
31156
30984
  };
31157
30985
  const onDownloadAcceptedTermsOfServiceDocument = async () => {
31158
30986
  try {
31159
- if (!canDownload)
31160
- return;
30987
+ if (!canDownload) return;
31161
30988
  const response = await handleDownloadAcceptedTermsOfServiceDocument(legalEntityResponse.id, activeForm.acceptanceId);
31162
30989
  await downloadFile(response.document, `${i18n.get(activeForm.formName)}.pdf`);
31163
30990
  } catch (e) {
@@ -31925,8 +31752,7 @@ const useNavigation = ({
31925
31752
  }
31926
31753
  }, [onNavigate]);
31927
31754
  const navigateBack = useCallback((stepCount = 1) => {
31928
- if (taskHistory.length <= 1)
31929
- return;
31755
+ if (taskHistory.length <= 1) return;
31930
31756
  const prevTask = taskHistory[taskHistory.length - (stepCount + 1)];
31931
31757
  if (prevTask === "default") {
31932
31758
  throw Error("Cannot navigate back to 'default' task");
@@ -31966,17 +31792,17 @@ const getDefaultTask = ({
31966
31792
  showIntroduction,
31967
31793
  shouldShowSingpassSelection
31968
31794
  }) => {
31795
+ const hasLegalEntityProgressedBeyondEntitySelection = hasProgressedBeyondEntitySelection(legalEntity);
31796
+ if (isNewEntryFlowEnabled && !accountHolder2 && !hasLegalEntityProgressedBeyondEntitySelection) return TaskTypes.BUSINESS_TYPE_SELECTION;
31797
+ if (showIntroduction) return TaskTypes.INTRODUCTION;
31798
+ if (shouldShowSingpassSelection) return TaskTypes.SINGPASS_SELECTION;
31799
+ return TaskTypes.TASKS_OVERVIEW;
31800
+ };
31801
+ const hasProgressedBeyondEntitySelection = (legalEntity) => {
31969
31802
  var _a, _b;
31970
31803
  const hasOwnEntityAssocation = (_a = legalEntity.entityAssociations) == null ? void 0 : _a.some((ea) => ea.associatorId === legalEntity.id);
31971
31804
  const hasOrganizationType = (_b = legalEntity.organization) == null ? void 0 : _b.type;
31972
- const hasProgressedBeyondEntitySelection = hasOwnEntityAssocation || !!hasOrganizationType;
31973
- if (isNewEntryFlowEnabled && !accountHolder2 && !hasProgressedBeyondEntitySelection)
31974
- return TaskTypes.BUSINESS_TYPE_SELECTION;
31975
- if (showIntroduction)
31976
- return TaskTypes.INTRODUCTION;
31977
- if (shouldShowSingpassSelection)
31978
- return TaskTypes.SINGPASS_SELECTION;
31979
- return TaskTypes.TASKS_OVERVIEW;
31805
+ return hasOwnEntityAssocation || !!hasOrganizationType;
31980
31806
  };
31981
31807
  const PAGES_WITH_POLLING = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
31982
31808
  const POLLING_INTERVAL = 3e3;
@@ -32117,8 +31943,7 @@ function DropinComposerComponent({
32117
31943
  }
32118
31944
  }, [additionalSalesChannels, i18n, rootLegalEntity.id, args.handleGetPciTemplate]);
32119
31945
  useEffect(() => {
32120
- if (!tasks.includes(TaskTypes.PCI_DSS))
32121
- return;
31946
+ if (!tasks.includes(TaskTypes.PCI_DSS)) return;
32122
31947
  getPciTemplate2().catch(logger$b.error);
32123
31948
  }, [getPciTemplate2, tasks]);
32124
31949
  const addFetchedAcceptedByName = async (acceptanceInfo) => {
@@ -32786,7 +32611,8 @@ function DropinComposerComponent({
32786
32611
  handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
32787
32612
  handleFindAddress: args == null ? void 0 : args.handleFindAddress,
32788
32613
  onTypeSwitch: navigateToTypeSwitcher,
32789
- isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION
32614
+ isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION,
32615
+ accountHolder: accountHolder2
32790
32616
  });
32791
32617
  case TaskTypes.COMPANY_SEARCH:
32792
32618
  return jsx(CompanySearchDropinComponent, {
@@ -32843,7 +32669,8 @@ function DropinComposerComponent({
32843
32669
  homeButtonLabel: i18n.get("saveAndGoToOverview"),
32844
32670
  associationDetail: trustMember,
32845
32671
  handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
32846
- handleFindAddress: args == null ? void 0 : args.handleFindAddress
32672
+ handleFindAddress: args == null ? void 0 : args.handleFindAddress,
32673
+ accountHolder: accountHolder2
32847
32674
  });
32848
32675
  case TaskTypes.PAYOUT:
32849
32676
  case TaskTypes.PAYIN:
@@ -34214,11 +34041,9 @@ function ViewVerificationStatusComponent({
34214
34041
  const [onboardingStatus, setOnboardingStatus] = useState();
34215
34042
  const [alertContent, setAlertContent] = useState();
34216
34043
  const content = useMemo(() => {
34217
- if (!onboardingStatus)
34218
- return;
34044
+ if (!onboardingStatus) return;
34219
34045
  const statusContent = getContentByStatus(onboardingStatus);
34220
- if (statusContent)
34221
- return statusContent;
34046
+ if (statusContent) return statusContent;
34222
34047
  logger$5.error(`there is no content for status "${onboardingStatus}"`);
34223
34048
  }, [onboardingStatus]);
34224
34049
  const handleError = ({
@@ -34474,8 +34299,7 @@ const buildSpriteDOMFromResponse = (responseData) => {
34474
34299
  return iconContainer;
34475
34300
  };
34476
34301
  const loadDocumentGuidance = async (loadingContext) => {
34477
- if (isDocumentGuidanceLoaded)
34478
- return;
34302
+ if (isDocumentGuidanceLoaded) return;
34479
34303
  isDocumentGuidanceLoaded = true;
34480
34304
  const responseData = await http({
34481
34305
  loadingContext,
@@ -34798,7 +34622,7 @@ const ConfigurationApiProvider = ({
34798
34622
  isEmbeddedDropin,
34799
34623
  loadingContext
34800
34624
  } = authContext;
34801
- const sdkVersion = "3.15.1";
34625
+ const sdkVersion = "3.15.3";
34802
34626
  useAnalytics({
34803
34627
  onUserEvent,
34804
34628
  legalEntityId: rootLegalEntityId,
@@ -34901,12 +34725,10 @@ const useTranslations = ({
34901
34725
  getDataset: getDataset2
34902
34726
  } = useConfigurationApi();
34903
34727
  useEffect(() => {
34904
- if (!allowedLocales)
34905
- return;
34728
+ if (!allowedLocales) return;
34906
34729
  const isLocaleAllowed = allowedLocales.includes(locale);
34907
34730
  const localeToUse = isLocaleAllowed ? locale : FALLBACK_LOCALE;
34908
- if (loaded.locale === localeToUse)
34909
- return;
34731
+ if (loaded.locale === localeToUse) return;
34910
34732
  if (!isLocaleAllowed) {
34911
34733
  logger.error(`
34912
34734
  "${locale}" isn't a supported locale. Please use one of the following:
@@ -34957,6 +34779,13 @@ const I18nProvider = ({
34957
34779
  children
34958
34780
  });
34959
34781
  };
34782
+ const QueryClient = new QueryClient$1();
34783
+ const QueryClientProvider = ({
34784
+ children
34785
+ }) => jsx(QueryClientProvider$1, {
34786
+ client: QueryClient,
34787
+ children
34788
+ });
34960
34789
  const settingsDefaults = {
34961
34790
  acceptedCountries: void 0,
34962
34791
  allowBankAccountFormatSelection: false,
@@ -34994,8 +34823,7 @@ function SettingsProvider({
34994
34823
  }
34995
34824
  function removeObjectPropsWithEmptyValues(obj) {
34996
34825
  keysOf(obj).forEach((key) => {
34997
- if (obj[key] === null || isEmpty(obj[key]))
34998
- delete obj[key];
34826
+ if (obj[key] === null || isEmpty(obj[key])) delete obj[key];
34999
34827
  });
35000
34828
  return obj;
35001
34829
  }
@@ -35275,10 +35103,8 @@ class BaseElement {
35275
35103
  }
35276
35104
  }
35277
35105
  const getRootLegalEntityId = (componentProps) => {
35278
- if ("legalEntityId" in componentProps)
35279
- return componentProps.legalEntityId;
35280
- if ("legalEntityResponse" in componentProps)
35281
- return componentProps.legalEntityResponse.id;
35106
+ if ("legalEntityId" in componentProps) return componentProps.legalEntityId;
35107
+ if ("legalEntityResponse" in componentProps) return componentProps.legalEntityResponse.id;
35282
35108
  throw new Error("You must provide either `legalEntityId` or `legalEntityResponse`");
35283
35109
  };
35284
35110
  class UIElement extends BaseElement {
@@ -35311,9 +35137,11 @@ class UIElement extends BaseElement {
35311
35137
  children: jsx(AutoResizer, {
35312
35138
  children: jsx(ToastContextProvider, {
35313
35139
  children: jsx(StateProvider, {
35314
- children: jsx(Component, {
35315
- ...this.props.componentProps,
35316
- eventEmitter: this.eventEmitter
35140
+ children: jsx(QueryClientProvider, {
35141
+ children: jsx(Component, {
35142
+ ...this.props.componentProps,
35143
+ eventEmitter: this.eventEmitter
35144
+ })
35317
35145
  })
35318
35146
  })
35319
35147
  })
@@ -36183,8 +36011,7 @@ class Core {
36183
36011
  };
36184
36012
  validateCoreOptions(newOptions);
36185
36013
  newOptions.loadingContext = normalizeEnvironment(newOptions.environment);
36186
- if (!newOptions.locale)
36187
- newOptions.locale = FALLBACK_LOCALE;
36014
+ if (!newOptions.locale) newOptions.locale = FALLBACK_LOCALE;
36188
36015
  return newOptions;
36189
36016
  };
36190
36017
  this.initializeSession = () => {