@adyen/kyc-components 3.51.1 → 3.51.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.
@@ -1,7 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { b as createContext, d as createSignal, o as onMount, e as createEffect, c as createMemo, a as createComponent, P as Portal, S as Show, t as template, i as insert, f as createRenderEffect, h as className, j as clearDelegatedEvents, k as delegateEvents, u as useContext, l as onCleanup, s as sortFns, m as mutationSortFns, n as on, p as setAttribute, q as getSidedProp, r as use, v as createUniqueId, w as batch, x as getQueryStatusLabel, y as getMutationStatusColor, z as getQueryStatusColor, A as getQueryStatusColorByLabel, B as displayValue, F as For, C as convertRemToPixels, D as untrack, $ as $TRACK, E as useTransition, G as spread, H as mergeProps, I as createRoot, J as serialize, K as Index, L as updateNestedDataByPath, M as addEventListener, N as stringify, O as Match, Q as Switch, R as deleteNestedDataByPath, T as splitProps, U as Dynamic, V as createComputed } from "./index-CA2oyCNl.js";
4
+ import { b as createContext, d as createSignal, o as onMount, e as createEffect, c as createMemo, a as createComponent, P as Portal, S as Show, t as template, i as insert, f as createRenderEffect, h as className, j as clearDelegatedEvents, k as delegateEvents, u as useContext, l as onCleanup, s as sortFns, m as mutationSortFns, n as on, p as setAttribute, q as getSidedProp, r as use, v as createUniqueId, w as batch, x as getQueryStatusLabel, y as getMutationStatusColor, z as getQueryStatusColor, A as getQueryStatusColorByLabel, B as displayValue, F as For, C as convertRemToPixels, D as untrack, $ as $TRACK, E as useTransition, G as spread, H as mergeProps, I as createRoot, J as serialize, K as Index, L as updateNestedDataByPath, M as addEventListener, N as stringify, O as Match, Q as Switch, R as deleteNestedDataByPath, T as splitProps, U as Dynamic, V as createComputed } from "./index-D3fRWeYh.js";
5
5
  var isNonNullable = (i2) => i2 != null;
6
6
  var filterNonNullable = (arr) => arr.filter(isNonNullable);
7
7
  function chain(callbacks) {
@@ -1,5 +1,5 @@
1
- import { c as createLocalStorage, T as THEME_PREFERENCE, P as PiPProvider, a as ThemeContext, D as Devtools, Q as QueryDevtoolsContext } from "./B4MFY5CR-DkcZuwrr.js";
2
- import { g as getPreferredColorScheme, c as createMemo, a as createComponent } from "./index-CA2oyCNl.js";
1
+ import { c as createLocalStorage, T as THEME_PREFERENCE, P as PiPProvider, a as ThemeContext, D as Devtools, Q as QueryDevtoolsContext } from "./B4MFY5CR-UJrID1s2.js";
2
+ import { g as getPreferredColorScheme, c as createMemo, a as createComponent } from "./index-D3fRWeYh.js";
3
3
  var DevtoolsComponent = (props) => {
4
4
  const [localStore, setLocalStore] = createLocalStorage({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
- import { c as createLocalStorage, T as THEME_PREFERENCE, P as PiPProvider, a as ThemeContext, b as ParentPanel, C as ContentView, Q as QueryDevtoolsContext } from "./B4MFY5CR-DkcZuwrr.js";
2
- import { g as getPreferredColorScheme, c as createMemo, a as createComponent } from "./index-CA2oyCNl.js";
1
+ import { c as createLocalStorage, T as THEME_PREFERENCE, P as PiPProvider, a as ThemeContext, b as ParentPanel, C as ContentView, Q as QueryDevtoolsContext } from "./B4MFY5CR-UJrID1s2.js";
2
+ import { g as getPreferredColorScheme, c as createMemo, a as createComponent } from "./index-D3fRWeYh.js";
3
3
  var DevtoolsPanelComponent = (props) => {
4
4
  const [localStore, setLocalStore] = createLocalStorage({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,4 +1,4 @@
1
- import { W } from "./index-CA2oyCNl.js";
1
+ import { W } from "./index-D3fRWeYh.js";
2
2
  export {
3
3
  W as default
4
4
  };
@@ -19440,7 +19440,7 @@ function PersonalDetails(props) {
19440
19440
  onBlur: handleFieldChange("jobTitle", "blur"),
19441
19441
  "aria-required": true,
19442
19442
  "aria-label": formUtils.getLabel("jobTitle"),
19443
- "aria-invalid": !fieldValidationErrors.birthDate
19443
+ "aria-invalid": !(valid == null ? void 0 : valid.jobTitle)
19444
19444
  }
19445
19445
  )
19446
19446
  }
@@ -29482,7 +29482,7 @@ const additionalIdentityInfo = {
29482
29482
  rule: "issuerStateRequired"
29483
29483
  },
29484
29484
  licenseCardNumber: {
29485
- rule: "requiredIfIdentityTypeIsDriversLicense"
29485
+ rule: "licenseCardNumberRules"
29486
29486
  },
29487
29487
  expiryDate: {
29488
29488
  rule: "expiryDateRequired"
@@ -33081,6 +33081,10 @@ const CONTACTS_REQUIRED_FOR_COUNTRIES = [CountryCodes.NewZealand];
33081
33081
  const JOB_TITLE_REQUIRED_FOR_COUNTRIES = [CountryCodes.NewZealand];
33082
33082
  const ISSUER_REQUIRED_FOR_COUNTRIES = [CountryCodes.Australia];
33083
33083
  const EXPIRY_DATE_REQUIRED_FOR_COUNTRIES = [CountryCodes.NewZealand];
33084
+ const LICENSE_CARD_NUMBER_REQUIRED_FOR_COUNTRIES = [
33085
+ CountryCodes.NewZealand,
33086
+ CountryCodes.Australia
33087
+ ];
33084
33088
  const DECISION_MAKER_TYPES_WITH_JOBTITLE = [
33085
33089
  DecisionMakerType.SIGNATORY,
33086
33090
  DecisionMakerType.CONTROLLING_PERSON
@@ -33219,9 +33223,9 @@ const rules$2 = ({
33219
33223
  return REQUIRED;
33220
33224
  }
33221
33225
  },
33222
- requiredIfIdentityTypeIsDriversLicense: () => {
33226
+ licenseCardNumberRules: () => {
33223
33227
  var _a2;
33224
- if (((_a2 = data.personalDetails) == null ? void 0 : _a2.typeOfIdentity) === "driversLicense") {
33228
+ if (((_a2 = data.personalDetails) == null ? void 0 : _a2.typeOfIdentity) === "driversLicense" && LICENSE_CARD_NUMBER_REQUIRED_FOR_COUNTRIES.includes(country)) {
33225
33229
  return REQUIRED;
33226
33230
  }
33227
33231
  },
@@ -33231,7 +33235,12 @@ const rules$2 = ({
33231
33235
  return REQUIRED;
33232
33236
  }
33233
33237
  },
33234
- expiryDateRequired: () => EXPIRY_DATE_REQUIRED_FOR_COUNTRIES.includes(country) ? REQUIRED : void 0,
33238
+ expiryDateRequired: () => {
33239
+ var _a2;
33240
+ if (((_a2 = data.personalDetails) == null ? void 0 : _a2.typeOfIdentity) === "passport" && EXPIRY_DATE_REQUIRED_FOR_COUNTRIES.includes(country)) {
33241
+ return REQUIRED;
33242
+ }
33243
+ },
33235
33244
  legalRepresentativeRelationshipRequired: () => taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS ? REQUIRED : void 0,
33236
33245
  isProofOfRelationshipRequired: () => void 0,
33237
33246
  // not required until more clarity from product
@@ -39808,6 +39817,18 @@ const nameValidationRulesV4 = {
39808
39817
  }
39809
39818
  ]
39810
39819
  };
39820
+ const specialCharsRegEx = getFormattingRegEx(SPECIAL_CHARS.replace("-", ""));
39821
+ const nameFormatters = {
39822
+ firstName: {
39823
+ // formatter: trimValWithOneSpace // just trim
39824
+ // Example - removing disallowed chars as they are input: then they don't end up in state
39825
+ formatter: (val) => val ? trimValWithOneSpace(val).replace(specialCharsRegEx, "") : void 0
39826
+ // trim & replace
39827
+ },
39828
+ lastName: {
39829
+ formatter: (val) => val ? trimValWithOneSpace(val).replace(specialCharsRegEx, "") : void 0
39830
+ }
39831
+ };
39811
39832
  const nomineeDecisionMakerRoleValidationRules = {
39812
39833
  nomineeShareholder: {
39813
39834
  modes: ["blur"],
@@ -39959,7 +39980,7 @@ function IndividualDropin({
39959
39980
  trustedFieldsProvider,
39960
39981
  trustedRoles
39961
39982
  }) {
39962
- var _a2, _b2, _c2, _d2;
39983
+ var _a2, _b2, _c2, _d2, _e2;
39963
39984
  const { accountHolder, setAccountHolder, idVerificationProviderId } = useCoreContext();
39964
39985
  const { isEmbeddedDropin } = useAuthContext();
39965
39986
  const { i18n } = useI18nContext();
@@ -39991,7 +40012,7 @@ function IndividualDropin({
39991
40012
  const [loadingStatus, setLoadingStatus] = useState("success");
39992
40013
  const [documents, setDocuments] = useState();
39993
40014
  const [existingAttachments, setExistingAttachments] = useState();
39994
- const [country] = useState(
40015
+ const [country, setCountry] = useState(
39995
40016
  ((_a2 = dataFromResponse == null ? void 0 : dataFromResponse.personalDetails) == null ? void 0 : _a2.residencyCountry) ?? parentCountry
39996
40017
  );
39997
40018
  const [hideFooter, setHideFooter] = useState(false);
@@ -40015,7 +40036,7 @@ function IndividualDropin({
40015
40036
  }, []);
40016
40037
  const individualFieldValidations = useCallback(
40017
40038
  (data2) => {
40018
- var _a3, _b3, _c3, _d3, _e2, _f2, _g2, _h2, _i2;
40039
+ var _a3, _b3, _c3, _d3, _e3, _f2, _g2, _h2, _i2;
40019
40040
  return {
40020
40041
  personalDetails: personalDetailsValidators({
40021
40042
  country: ((_a3 = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _a3.residencyCountry) ?? country,
@@ -40024,7 +40045,7 @@ function IndividualDropin({
40024
40045
  taskType,
40025
40046
  idNumberType: (_b3 = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _b3.typeOfIdentity,
40026
40047
  phonePrefix: (_d3 = (_c3 = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _c3.phone) == null ? void 0 : _d3.phoneCountryCode,
40027
- idNumberExempt: (_e2 = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _e2.idNumberExempt,
40048
+ idNumberExempt: (_e3 = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _e3.idNumberExempt,
40028
40049
  idNumber: (_f2 = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _f2.idNumber,
40029
40050
  existingIdNumber: (_g2 = dataFromResponse.personalDetails) == null ? void 0 : _g2.idNumber,
40030
40051
  formVerificationErrors: (_h2 = propProblems == null ? void 0 : propProblems.verificationErrors) == null ? void 0 : _h2.personalDetails
@@ -40058,14 +40079,28 @@ function IndividualDropin({
40058
40079
  }),
40059
40080
  [legalEntityResponse, documents, isTargetLegalEntityType, dataFromResponse]
40060
40081
  );
40082
+ const formatters = useMemo(
40083
+ () => ({
40084
+ personalDetails: {
40085
+ ...nameFormatters
40086
+ },
40087
+ address: addressFormatters
40088
+ }),
40089
+ []
40090
+ );
40061
40091
  const form = useMultiForm({
40062
40092
  requiredFields: derivedProps == null ? void 0 : derivedProps.requiredFields,
40063
40093
  defaultData,
40064
40094
  rules: individualFieldValidations,
40065
40095
  asyncRules: individualFieldAsyncValidations,
40066
- optionalFields: derivedProps == null ? void 0 : derivedProps.optionalFields
40096
+ optionalFields: derivedProps == null ? void 0 : derivedProps.optionalFields,
40097
+ formatters
40067
40098
  });
40068
40099
  const { data = dataFromResponse } = form;
40100
+ useEffect(() => {
40101
+ var _a3;
40102
+ setCountry(((_a3 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a3.residencyCountry) ?? parentCountry);
40103
+ }, [(_b2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _b2.residencyCountry, parentCountry]);
40069
40104
  const getConfigurationData = useCallback(
40070
40105
  () => getConfiguration2({
40071
40106
  legalEntityType: LegalEntityType.INDIVIDUAL,
@@ -40130,14 +40165,14 @@ function IndividualDropin({
40130
40165
  roleTypes = getAllowedDecisionMakerRoles(parentLegalEntity, taskType);
40131
40166
  }
40132
40167
  if (parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations) {
40133
- const associations = (_b2 = parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations) == null ? void 0 : _b2.filter(
40168
+ const associations = (_c2 = parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations) == null ? void 0 : _c2.filter(
40134
40169
  (ea) => ea.legalEntityId === (legalEntityResponse == null ? void 0 : legalEntityResponse.id)
40135
40170
  );
40136
40171
  if (associations && associations.length > 0) {
40137
40172
  if (isRoleTypeTask && parentLegalEntity) {
40138
- const jobTitle = (_c2 = associations.find(
40173
+ const jobTitle = (_d2 = associations.find(
40139
40174
  (association) => Boolean(association.jobTitle)
40140
- )) == null ? void 0 : _c2.jobTitle;
40175
+ )) == null ? void 0 : _d2.jobTitle;
40141
40176
  dataFromResponse = {
40142
40177
  ...dataFromResponse,
40143
40178
  personalDetails: {
@@ -40278,7 +40313,7 @@ function IndividualDropin({
40278
40313
  parentLE,
40279
40314
  dataSubmitted
40280
40315
  }) => {
40281
- var _a3, _b3, _c3, _d3, _e2, _f2;
40316
+ var _a3, _b3, _c3, _d3, _e3, _f2;
40282
40317
  const newRoles = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER ? (_a3 = dataSubmitted == null ? void 0 : dataSubmitted.personalDetails) == null ? void 0 : _a3.role : taskType === TaskTypes.TRUST_MEMBER_INDIVIDUAL ? trustMember == null ? void 0 : trustMember.roles : null;
40283
40318
  const existingEntityAssociations = getOwnEntityAssociations(parentLE);
40284
40319
  if (newRoles && (hasRolesChanged(legalEntity2, existingEntityAssociations, newRoles) || ((_b3 = dataFromResponse.personalDetails) == null ? void 0 : _b3.jobTitle) !== ((_c3 = dataSubmitted == null ? void 0 : dataSubmitted.personalDetails) == null ? void 0 : _c3.jobTitle) || hasNomineesChanged(dataFromResponse.personalDetails, dataSubmitted.nominee))) {
@@ -40304,7 +40339,7 @@ function IndividualDropin({
40304
40339
  }
40305
40340
  await handleUpdateLegalEntity(updatedParentLegalEntity, parentLE.id);
40306
40341
  }
40307
- if (taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS && (existingEntityAssociations.every((ea) => ea.legalEntityId !== legalEntity2.id) || ((_d3 = dataFromResponse == null ? void 0 : dataFromResponse.personalDetails) == null ? void 0 : _d3.relationship) !== ((_e2 = dataSubmitted == null ? void 0 : dataSubmitted.personalDetails) == null ? void 0 : _e2.relationship))) {
40342
+ if (taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS && (existingEntityAssociations.every((ea) => ea.legalEntityId !== legalEntity2.id) || ((_d3 = dataFromResponse == null ? void 0 : dataFromResponse.personalDetails) == null ? void 0 : _d3.relationship) !== ((_e3 = dataSubmitted == null ? void 0 : dataSubmitted.personalDetails) == null ? void 0 : _e3.relationship))) {
40308
40343
  const newEntityAssociation = {
40309
40344
  type: "legalRepresentative",
40310
40345
  legalEntityId: legalEntity2.id,
@@ -40441,7 +40476,7 @@ function IndividualDropin({
40441
40476
  };
40442
40477
  };
40443
40478
  const formatDataForSummary2 = () => {
40444
- var _a3, _b3, _c3, _d3, _e2, _f2, _g2;
40479
+ var _a3, _b3, _c3, _d3, _e3, _f2, _g2;
40445
40480
  let summaryData = cloneObject(data);
40446
40481
  if ((_a3 = summaryData.personalDetails) == null ? void 0 : _a3.residencyCountry) {
40447
40482
  summaryData.personalDetails.residencyCountry = datasetUtils.getCountryName(
@@ -40471,7 +40506,7 @@ function IndividualDropin({
40471
40506
  i18n.locale
40472
40507
  );
40473
40508
  }
40474
- if ((_e2 = summaryData.personalDetails) == null ? void 0 : _e2.phone) {
40509
+ if ((_e3 = summaryData.personalDetails) == null ? void 0 : _e3.phone) {
40475
40510
  delete summaryData.personalDetails.phone;
40476
40511
  summaryData.personalDetails.phoneNumber = (_g2 = (_f2 = data.personalDetails) == null ? void 0 : _f2.phone) == null ? void 0 : _g2.number;
40477
40512
  }
@@ -40479,7 +40514,7 @@ function IndividualDropin({
40479
40514
  };
40480
40515
  const summaryOmittedKeys = [
40481
40516
  ...taskType === TaskTypes.DECISION_MAKER ? ["role"] : [],
40482
- ...((_d2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _d2.idNumberExempt) ? ["idNumber"] : []
40517
+ ...((_e2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _e2.idNumberExempt) ? ["idNumber"] : []
40483
40518
  ];
40484
40519
  const {
40485
40520
  handleNextClick,
@@ -52157,7 +52192,7 @@ const ConfigurationApiProvider = ({
52157
52192
  }) => {
52158
52193
  const authContext = useAuthContext();
52159
52194
  const { isEmbeddedDropin, loadingContext } = authContext;
52160
- const sdkVersion = "3.51.1";
52195
+ const sdkVersion = "3.51.3";
52161
52196
  const rootLegalEntityId = useGlobalStore((store) => store.rootLegalEntity.id);
52162
52197
  useAnalytics({
52163
52198
  onUserEvent,
@@ -52897,7 +52932,7 @@ const DebugModal = ({ onExit }) => {
52897
52932
  const [tab, setTab] = useState("metadata");
52898
52933
  const rootLegalEntity = useGlobalStore((store) => store.rootLegalEntity);
52899
52934
  const metadata = {
52900
- sdkVersion: "3.51.1",
52935
+ sdkVersion: "3.51.3",
52901
52936
  locale: i18n.locale,
52902
52937
  rootLegalEntityId: rootLegalEntity.id
52903
52938
  };
@@ -55894,7 +55929,7 @@ var TanstackQueryDevtools = (_k = class {
55894
55929
  if (__privateGet(this, _Component)) {
55895
55930
  Devtools = __privateGet(this, _Component);
55896
55931
  } else {
55897
- Devtools = lazy(() => import("./HO4MOOFI-C34-7HCT.js"));
55932
+ Devtools = lazy(() => import("./HO4MOOFI-CGublxkZ.js"));
55898
55933
  __privateSet(this, _Component, Devtools);
55899
55934
  }
55900
55935
  setupStyleSheet(__privateGet(this, _styleNonce), __privateGet(this, _shadowDOMTarget));
@@ -56016,7 +56051,7 @@ var TanstackQueryDevtoolsPanel = (_l = class {
56016
56051
  if (__privateGet(this, _Component2)) {
56017
56052
  Devtools = __privateGet(this, _Component2);
56018
56053
  } else {
56019
- Devtools = lazy(() => import("./HUY7CZI3-amkPei4o.js"));
56054
+ Devtools = lazy(() => import("./HUY7CZI3-I14bSv-8.js"));
56020
56055
  __privateSet(this, _Component2, Devtools);
56021
56056
  }
56022
56057
  setupStyleSheet(__privateGet(this, _styleNonce2), __privateGet(this, _shadowDOMTarget2));
@@ -11,5 +11,6 @@ export declare const CONTACTS_REQUIRED_FOR_COUNTRIES: CountryCode[];
11
11
  export declare const JOB_TITLE_REQUIRED_FOR_COUNTRIES: CountryCode[];
12
12
  export declare const ISSUER_REQUIRED_FOR_COUNTRIES: CountryCode[];
13
13
  export declare const EXPIRY_DATE_REQUIRED_FOR_COUNTRIES: CountryCode[];
14
+ export declare const LICENSE_CARD_NUMBER_REQUIRED_FOR_COUNTRIES: CountryCode[];
14
15
  export declare const DECISION_MAKER_TYPES_WITH_JOBTITLE: DecisionMakerType[];
15
16
  export declare const rules: FormRules<IndividualSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "3.51.1",
3
+ "version": "3.51.3",
4
4
  "keywords": [
5
5
  "adyen",
6
6
  "adyen-kyc",