@adyen/kyc-components 3.61.0 → 3.61.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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 "./WXAWMS3D-DfMYoZIT.js";
2
- import { p as getPreferredColorScheme, q as createMemo, r as createComponent } from "./core-CUc_u-se.js";
1
+ import { c as createLocalStorage, T as THEME_PREFERENCE, P as PiPProvider, a as ThemeContext, D as Devtools, Q as QueryDevtoolsContext } from "./WXAWMS3D-6HY5ACHQ.js";
2
+ import { p as getPreferredColorScheme, q as createMemo, r as createComponent } from "./core-DnJXG_2z.js";
3
3
  var DevtoolsComponent = (props) => {
4
4
  const [localStore, setLocalStore] = createLocalStorage({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
2
2
  import { useMemo, useState } from "preact/hooks";
3
- import { B as Button, d as Tag, e as entriesOf, I as InputText, b as useI18nContext, s as splitTaskIdentifier, f as TaskItemStatus, h as useExperimentsContext, i as useSettingsContext, j as useGlobalStore, l as listToRecord, v as valuesOf, k as useTaskStatuses, M as Modal, m as createLogger, n as Icon, o as SettingNames, E as ExperimentNames } from "./core-CUc_u-se.js";
3
+ import { B as Button, d as Tag, e as entriesOf, I as InputText, b as useI18nContext, s as splitTaskIdentifier, f as TaskItemStatus, h as useExperimentsContext, i as useSettingsContext, j as useGlobalStore, l as listToRecord, v as valuesOf, k as useTaskStatuses, M as Modal, m as createLogger, n as Icon, o as SettingNames, E as ExperimentNames } from "./core-DnJXG_2z.js";
4
4
  const tabs = "adyen-kyc-tabs";
5
5
  const styles$1 = {
6
6
  tabs
@@ -135,10 +135,10 @@ const transformModule = (highlights, codeNode, scope) => {
135
135
  };
136
136
  const supportedModules = ["plaintext", "json", "yaml", "css"];
137
137
  const moduleMap = {
138
- plaintext: () => import("./plaintext-DynNaQ1e.js"),
139
- json: () => import("./json-BtTKDKYr.js"),
140
- yaml: () => import("./yaml-CPsIjNz4.js"),
141
- css: () => import("./css-DSD3BfBv.js")
138
+ plaintext: () => import("./plaintext-Cv8TglfR.js"),
139
+ json: () => import("./json-CfYJ8CuG.js"),
140
+ yaml: () => import("./yaml-CQz3uVGi.js"),
141
+ css: () => import("./css-DWtBz-U6.js")
142
142
  };
143
143
  const getModule = async (name) => {
144
144
  if (!supportedModules.includes(name)) {
@@ -429,7 +429,7 @@ const DebugModal = ({ onExit }) => {
429
429
  const [tab, setTab] = useState("metadata");
430
430
  const rootLegalEntity = useGlobalStore((store) => store.rootLegalEntity);
431
431
  const metadata = {
432
- sdkVersion: "3.61.0",
432
+ sdkVersion: "3.61.1",
433
433
  locale: i18n.locale,
434
434
  rootLegalEntityId: rootLegalEntity.id
435
435
  };
@@ -1,6 +1,6 @@
1
1
  import { jsxs, Fragment, jsx } from "preact/jsx-runtime";
2
2
  import { useMemo as useMemo$1, useState, useEffect } from "preact/hooks";
3
- import { T as TaskTypes, L as LegalEntityType, u as useCanSeeIntroduction, a as useLegalEntityType, t as toCapitalized, g as getTranslationKeysByPrefix, b as useI18nContext, c as useAnalyticsContext, S as StepProgressIndicator, B as Button } from "./core-CUc_u-se.js";
3
+ import { T as TaskTypes, L as LegalEntityType, u as useCanSeeIntroduction, a as useLegalEntityType, t as toCapitalized, g as getTranslationKeysByPrefix, b as useI18nContext, c as useAnalyticsContext, S as StepProgressIndicator, B as Button } from "./core-DnJXG_2z.js";
4
4
  import { useMemo } from "preact/compat";
5
5
  var IntroductionScreens = ((IntroductionScreens2) => {
6
6
  IntroductionScreens2["PROLOGUE"] = "PROLOGUE";
@@ -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 "./WXAWMS3D-DfMYoZIT.js";
2
- import { p as getPreferredColorScheme, q as createMemo, r as createComponent } from "./core-CUc_u-se.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 "./WXAWMS3D-6HY5ACHQ.js";
2
+ import { p as getPreferredColorScheme, q as createMemo, r as createComponent } from "./core-DnJXG_2z.js";
3
3
  var DevtoolsPanelComponent = (props) => {
4
4
  const [localStore, setLocalStore] = createLocalStorage({
5
5
  prefix: "TanstackQueryDevtools"
@@ -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 { w as createContext, x as createSignal, y as onMount, z as createEffect, q as createMemo, r as createComponent, P as Portal, A as Show, D as template, F as insert, G as createRenderEffect, H as className, J as clearDelegatedEvents, K as delegateEvents, N as useContext, O as onCleanup, Q as sortFns, R as mutationSortFns, U as on, V as setAttribute, W as getSidedProp, X as use, Y as createUniqueId, Z as batch, _ as getQueryStatusLabel, $ as getMutationStatusColor, a0 as getQueryStatusColor, a1 as getQueryStatusColorByLabel, a2 as displayValue, a3 as For, a4 as convertRemToPixels, a5 as untrack, a6 as $TRACK, a7 as useTransition, a8 as spread, a9 as mergeProps, aa as createRoot, ab as serialize, ac as Index, ad as updateNestedDataByPath, ae as addEventListener, af as stringify, ag as Match, ah as Switch, ai as deleteNestedDataByPath, aj as splitProps, ak as Dynamic, al as createComputed } from "./core-CUc_u-se.js";
4
+ import { w as createContext, x as createSignal, y as onMount, z as createEffect, q as createMemo, r as createComponent, P as Portal, A as Show, D as template, F as insert, G as createRenderEffect, H as className, J as clearDelegatedEvents, K as delegateEvents, N as useContext, O as onCleanup, Q as sortFns, R as mutationSortFns, U as on, V as setAttribute, W as getSidedProp, X as use, Y as createUniqueId, Z as batch, _ as getQueryStatusLabel, $ as getMutationStatusColor, a0 as getQueryStatusColor, a1 as getQueryStatusColorByLabel, a2 as displayValue, a3 as For, a4 as convertRemToPixels, a5 as untrack, a6 as $TRACK, a7 as useTransition, a8 as spread, a9 as mergeProps, aa as createRoot, ab as serialize, ac as Index, ad as updateNestedDataByPath, ae as addEventListener, af as stringify, ag as Match, ah as Switch, ai as deleteNestedDataByPath, aj as splitProps, ak as Dynamic, al as createComputed } from "./core-DnJXG_2z.js";
5
5
  var isNonNullable = (i2) => i2 != null;
6
6
  var filterNonNullable = (arr) => arr.filter(isNonNullable);
7
7
  function chain(callbacks) {
@@ -1,4 +1,4 @@
1
- import { C as Core } from "./core-CUc_u-se.js";
1
+ import { C as Core } from "./core-DnJXG_2z.js";
2
2
  if (CSS.supports("container", "foo / inline-size") === false) {
3
3
  import("container-query-polyfill");
4
4
  }
@@ -1,4 +1,4 @@
1
- import { C as Core } from "./core-CUc_u-se.js";
1
+ import { C as Core } from "./core-DnJXG_2z.js";
2
2
  const environmentMap = Object.freeze({
3
3
  live: "https://live.adyen.com",
4
4
  test: "https://test.adyen.com"
@@ -28172,6 +28172,11 @@ const mandatoryApiFields = {
28172
28172
  "personalDetails.lastName",
28173
28173
  "personalDetails.residencyCountry"
28174
28174
  ],
28175
+ INDIVIDUAL_ONFIDO: [
28176
+ "basicDetails.firstName",
28177
+ "basicDetails.lastName",
28178
+ "additionalPersonalDetails.country"
28179
+ ],
28175
28180
  DECISIONMAKER: [
28176
28181
  "personalDetails.firstName",
28177
28182
  "personalDetails.lastName",
@@ -31957,15 +31962,10 @@ const rules$1 = ({
31957
31962
  requiredIfPhoneScenarioDisabled: () => !isExperimentEnabled("EnablePhoneFieldScenario") ? REQUIRED$1 : void 0,
31958
31963
  jobTitleIfRequiredForRole: () => {
31959
31964
  var _a2, _b2;
31960
- if (taskType === TaskTypes.DECISION_MAKER) {
31961
- if ((_b2 = (_a2 = data.personalDetails) == null ? void 0 : _a2.role) == null ? void 0 : _b2.some(
31962
- (role) => DECISION_MAKER_TYPES_WITH_JOBTITLE$1.includes(role)
31963
- )) {
31964
- return REQUIRED$1;
31965
- }
31966
- return;
31967
- }
31968
- if (JOB_TITLE_REQUIRED_FOR_COUNTRIES$1.includes(country)) {
31965
+ if (taskType !== TaskTypes.DECISION_MAKER) return;
31966
+ if (((_b2 = (_a2 = data.personalDetails) == null ? void 0 : _a2.role) == null ? void 0 : _b2.some(
31967
+ (role) => DECISION_MAKER_TYPES_WITH_JOBTITLE$1.includes(role)
31968
+ )) || JOB_TITLE_REQUIRED_FOR_COUNTRIES$1.includes(country)) {
31969
31969
  return REQUIRED$1;
31970
31970
  }
31971
31971
  },
@@ -32237,14 +32237,117 @@ const getTargetLegalEntityType = (businessType, legalArrangement, trusteeType, c
32237
32237
  return currentLegalEntityType;
32238
32238
  };
32239
32239
  const isLegalArrangementOrganizationSubtype = (legalArrangementOption) => legalArrangementOption === "partnershipIncorporated" || legalArrangementOption === "associationIncorporated";
32240
- const convertApiFieldNameToSchemaFieldName = (apiField, legalEntityType, isExperimentEnabled) => {
32240
+ const mapIndividualOnfidoSchemaToLegalEntity = (individualOnfido) => {
32241
+ var _a2, _b2;
32242
+ const legalEntity = {
32243
+ ...formatObject(individualOnfido, getAPISchemaFromIndividualSchema),
32244
+ type: LegalEntityType.INDIVIDUAL
32245
+ };
32246
+ if (individualOnfido.additionalPersonalDetails) {
32247
+ legalEntity.individual.identificationData = adjustIdentificationData(
32248
+ individualOnfido.additionalPersonalDetails,
32249
+ legalEntity.individual.identificationData
32250
+ );
32251
+ }
32252
+ if ((_a2 = individualOnfido.basicDetails) == null ? void 0 : _a2.phoneNumber) {
32253
+ const phone = {
32254
+ number: individualOnfido.basicDetails.phoneNumber.number,
32255
+ type: "mobile"
32256
+ };
32257
+ if (phone.number && legalEntity.individual) {
32258
+ legalEntity.individual.phone = phone;
32259
+ } else {
32260
+ (_b2 = legalEntity == null ? void 0 : legalEntity.individual) == null ? true : delete _b2.phone;
32261
+ }
32262
+ }
32263
+ return legalEntity;
32264
+ };
32265
+ const mapLegalEntityToIndividualOnfidoSchema = (legalEntity, isChangingType, isRoleFieldNeeded, parentLegalEntity) => {
32266
+ var _a2, _b2, _c2;
32267
+ let individualOnfido = {
32268
+ ...formatObject(legalEntity, getIndividualSchemaFromAPI)
32269
+ };
32270
+ individualOnfido = {
32271
+ ...individualOnfido,
32272
+ basicDetails: {
32273
+ ...individualOnfido == null ? void 0 : individualOnfido.basicDetails,
32274
+ ...isChangingType && {
32275
+ firstName: "",
32276
+ lastName: ""
32277
+ }
32278
+ }
32279
+ };
32280
+ if ((_a2 = legalEntity == null ? void 0 : legalEntity.documentDetails) == null ? void 0 : _a2.length) {
32281
+ individualOnfido = {
32282
+ ...individualOnfido,
32283
+ idVerificationMethod: {
32284
+ // Manually set verification method for existing document journey
32285
+ idVerificationMethod: "existingDocument",
32286
+ idDocument: mapDocumentDetailToIdDocument(legalEntity.documentDetails)
32287
+ }
32288
+ };
32289
+ }
32290
+ if (!(parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations)) {
32291
+ return individualOnfido;
32292
+ }
32293
+ const associations = ((_b2 = parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations) == null ? void 0 : _b2.filter((ea) => ea.legalEntityId === (legalEntity == null ? void 0 : legalEntity.id))) ?? [];
32294
+ if (isRoleFieldNeeded && individualOnfido.basicDetails) {
32295
+ individualOnfido.basicDetails.role = associations.map((ea) => ea.type);
32296
+ individualOnfido.basicDetails.jobTitle = (_c2 = associations.find(
32297
+ ({ jobTitle }) => Boolean(jobTitle)
32298
+ )) == null ? void 0 : _c2.jobTitle;
32299
+ }
32300
+ return individualOnfido;
32301
+ };
32302
+ const mapDocumentDetailToIdDocument = (documents) => {
32303
+ var _a2;
32304
+ const activeDocument = (_a2 = documents.filter((document2) => document2.active)) == null ? void 0 : _a2[0];
32305
+ return activeDocument ? {
32306
+ idDocumentType: activeDocument.type,
32307
+ modificationDate: activeDocument.modificationDate
32308
+ } : void 0;
32309
+ };
32310
+ const individualOnfidoObscuredFields = [
32311
+ "additionalPersonalDetails.idNumber",
32312
+ "additionalPersonalDetails.idNumberExempt"
32313
+ ];
32314
+ const individualOnfidoBaseMapping = {
32315
+ "basicDetails.firstName": "individual.name.firstName",
32316
+ "basicDetails.lastName": "individual.name.lastName",
32317
+ "basicDetails.phoneNumber.number": "individual.phone.number",
32318
+ "basicDetails.phoneNumber.phoneCountryCode": "individual.phone.phoneCountryCode",
32319
+ "basicDetails.phoneNumber.type": "individual.phone.type",
32320
+ "basicDetails.email": "individual.email",
32321
+ "additionalPersonalDetails.birthDate": "individual.birthData.dateOfBirth",
32322
+ "additionalPersonalDetails.idNumber": "individual.identificationData.number",
32323
+ "additionalPersonalDetails.idNumberExempt": "individual.identificationData.nationalIdExempt",
32324
+ "additionalPersonalDetails.typeOfIdentity": "individual.identificationData.type",
32325
+ "additionalPersonalDetails.issuerState": "individual.identificationData.issuerState",
32326
+ "additionalPersonalDetails.licenseCardNumber": "individual.identificationData.cardNumber",
32327
+ "additionalPersonalDetails.expiryDate": "individual.identificationData.expiryDate",
32328
+ "additionalPersonalDetails.nationality": "individual.nationality",
32329
+ // Address fields
32330
+ "additionalPersonalDetails.city": "individual.residentialAddress.city",
32331
+ "additionalPersonalDetails.country": "individual.residentialAddress.country",
32332
+ "additionalPersonalDetails.postalCode": "individual.residentialAddress.postalCode",
32333
+ "additionalPersonalDetails.stateOrProvince": "individual.residentialAddress.stateOrProvince",
32334
+ "additionalPersonalDetails.address": "individual.residentialAddress.street",
32335
+ "additionalPersonalDetails.otherAddressInformation": "individual.residentialAddress.street2"
32336
+ };
32337
+ const getIndividualSchemaFromAPI = {
32338
+ ...individualOnfidoBaseMapping
32339
+ };
32340
+ const getAPISchemaFromIndividualSchema = {
32341
+ ...reverseObject(individualOnfidoBaseMapping)
32342
+ };
32343
+ const convertApiFieldNameToSchemaFieldName = (apiField, legalEntityType, newFlow) => {
32241
32344
  switch (legalEntityType) {
32242
32345
  case LegalEntityType.INDIVIDUAL:
32243
- return apiField in individualApiKeyMapping ? individualApiKeyMapping[apiField] : void 0;
32346
+ return newFlow ? apiField in getAPISchemaFromIndividualSchema ? getAPISchemaFromIndividualSchema[apiField] : void 0 : apiField in individualApiKeyMapping ? individualApiKeyMapping[apiField] : void 0;
32244
32347
  case LegalEntityType.ORGANIZATION:
32245
- return (isExperimentEnabled == null ? void 0 : isExperimentEnabled("EnableNewBusinessDetailsFlow")) ? apiField in businessDetailsApiKeyMapping ? businessDetailsApiKeyMapping[apiField] : void 0 : apiField in companyApiKeyMapping ? companyApiKeyMapping[apiField] : void 0;
32348
+ return newFlow ? apiField in businessDetailsApiKeyMapping ? businessDetailsApiKeyMapping[apiField] : void 0 : apiField in companyApiKeyMapping ? companyApiKeyMapping[apiField] : void 0;
32246
32349
  case LegalEntityType.SOLE_PROPRIETORSHIP:
32247
- return (isExperimentEnabled == null ? void 0 : isExperimentEnabled("EnableSolePropUsingBusinessDetails")) ? apiField in solePropBusinessDetailsApiKeyMapping ? solePropBusinessDetailsApiKeyMapping[apiField] : void 0 : apiField in solePropApiKeyMapping ? solePropApiKeyMapping[apiField] : void 0;
32350
+ return newFlow ? apiField in solePropBusinessDetailsApiKeyMapping ? solePropBusinessDetailsApiKeyMapping[apiField] : void 0 : apiField in solePropApiKeyMapping ? solePropApiKeyMapping[apiField] : void 0;
32248
32351
  case LegalEntityType.TRUST:
32249
32352
  return apiField in trustApiKeyMapping ? trustApiKeyMapping[apiField] : void 0;
32250
32353
  case LegalEntityType.UNINCORPORATED_PARTNERSHIP:
@@ -32257,14 +32360,12 @@ const knownProblematicFields = [
32257
32360
  "personalDetails.typeOfIdentity",
32258
32361
  "personalDetails.issuerState"
32259
32362
  ];
32260
- const getFieldsWithExistingData = (legalEntity, isExperimentEnabled) => {
32363
+ const getFieldsWithExistingData = (legalEntity, newFlow = false) => {
32261
32364
  var _a2;
32262
32365
  const apiFieldsWithExistingData = getNestedPropertyKeys(legalEntity);
32263
32366
  const legalEntityType = legalEntity.type;
32264
32367
  if (!legalEntityType) return [];
32265
- const nonDocumentFields = apiFieldsWithExistingData.map(
32266
- (field) => convertApiFieldNameToSchemaFieldName(field, legalEntityType, isExperimentEnabled)
32267
- ).filter((field) => field !== void 0).filter((field) => !knownProblematicFields.includes(field));
32368
+ const nonDocumentFields = apiFieldsWithExistingData.map((field) => convertApiFieldNameToSchemaFieldName(field, legalEntityType, newFlow)).filter((field) => field !== void 0).filter((field) => !knownProblematicFields.includes(field));
32268
32369
  if ((_a2 = legalEntity.documentDetails) == null ? void 0 : _a2.length) {
32269
32370
  const documentFields = legalEntity.documentDetails.map((document2) => legalEntityDocumentToFieldMapping[legalEntityType][document2.type]).filter((field) => field !== void 0);
32270
32371
  return [...nonDocumentFields, ...documentFields];
@@ -35254,7 +35355,7 @@ function BusinessDetailsDropin({
35254
35355
  initialForms,
35255
35356
  (currentProblems == null ? void 0 : currentProblems.remediationActions) ? Object.values(currentProblems == null ? void 0 : currentProblems.remediationActions) : [],
35256
35357
  (currentProblems == null ? void 0 : currentProblems.missingData) ?? [],
35257
- subjectEntity ? getFieldsWithExistingData(subjectEntity, isExperimentEnabled) : [],
35358
+ subjectEntity ? getFieldsWithExistingData(subjectEntity, true) : [],
35258
35359
  customRules,
35259
35360
  {},
35260
35361
  {},
@@ -47681,13 +47782,8 @@ const IndividualOnfidoRules = ({
47681
47782
  requiredIfPhoneScenarioDisabled: () => !isExperimentEnabled("EnablePhoneFieldScenario") ? REQUIRED : void 0,
47682
47783
  jobTitleIfRequiredForRole: () => {
47683
47784
  var _a2, _b2;
47684
- if (taskType === TaskTypes.DECISION_MAKER) {
47685
- if ((_b2 = (_a2 = data.basicDetails) == null ? void 0 : _a2.role) == null ? void 0 : _b2.some((role) => DECISION_MAKER_TYPES_WITH_JOBTITLE.includes(role))) {
47686
- return REQUIRED;
47687
- }
47688
- return;
47689
- }
47690
- if (JOB_TITLE_REQUIRED_FOR_COUNTRIES.includes(country)) {
47785
+ if (taskType !== TaskTypes.DECISION_MAKER) return;
47786
+ if (((_b2 = (_a2 = data.basicDetails) == null ? void 0 : _a2.role) == null ? void 0 : _b2.some((role) => DECISION_MAKER_TYPES_WITH_JOBTITLE.includes(role))) || JOB_TITLE_REQUIRED_FOR_COUNTRIES.includes(country)) {
47691
47787
  return REQUIRED;
47692
47788
  }
47693
47789
  },
@@ -48809,7 +48905,7 @@ const OnfidoVerificationModal = ({
48809
48905
  onComplete
48810
48906
  }) => {
48811
48907
  const { i18n } = useI18nContext();
48812
- return /* @__PURE__ */ jsx$1(Modal, { size: "large", onClose: closeModal, ariaLabel: i18n.get("identityVerification"), children: minimumApplicantDetails && /* @__PURE__ */ jsx$1(
48908
+ return /* @__PURE__ */ jsx$1(Modal, { size: "medium", onClose: closeModal, ariaLabel: i18n.get("identityVerification"), children: minimumApplicantDetails && /* @__PURE__ */ jsx$1(
48813
48909
  IdVerification,
48814
48910
  {
48815
48911
  handleGetIdVerificationToken,
@@ -49260,90 +49356,6 @@ function IndividualOnfido(props) {
49260
49356
  };
49261
49357
  return /* @__PURE__ */ jsx$1("div", { className: "adyen-kyc-individual", children: /* @__PURE__ */ jsx$1("div", { className: "adyen-kyc-form-wrapper", children: renderActiveForm(propActiveForm) }) });
49262
49358
  }
49263
- const mapIndividualOnfidoSchemaToLegalEntity = (individualOnfido) => {
49264
- var _a2, _b2;
49265
- const legalEntity = {
49266
- ...formatObject(individualOnfido, getAPISchemaFromIndividualSchema),
49267
- type: LegalEntityType.INDIVIDUAL
49268
- };
49269
- if ((_a2 = individualOnfido.basicDetails) == null ? void 0 : _a2.phoneNumber) {
49270
- const phone = {
49271
- number: individualOnfido.basicDetails.phoneNumber.number,
49272
- type: "mobile"
49273
- };
49274
- if (phone.number && legalEntity.individual) {
49275
- legalEntity.individual.phone = phone;
49276
- } else {
49277
- (_b2 = legalEntity == null ? void 0 : legalEntity.individual) == null ? true : delete _b2.phone;
49278
- }
49279
- }
49280
- return legalEntity;
49281
- };
49282
- const mapLegalEntityToIndividualOnfidoSchema = (legalEntity, isChangingType, isRoleFieldNeeded, parentLegalEntity) => {
49283
- var _a2, _b2, _c2;
49284
- let individualOnfido = {
49285
- ...formatObject(legalEntity, getIndividualSchemaFromAPI)
49286
- };
49287
- individualOnfido = {
49288
- ...individualOnfido,
49289
- basicDetails: {
49290
- ...individualOnfido == null ? void 0 : individualOnfido.basicDetails,
49291
- ...isChangingType && {
49292
- firstName: "",
49293
- lastName: ""
49294
- }
49295
- }
49296
- };
49297
- if ((_a2 = legalEntity == null ? void 0 : legalEntity.documentDetails) == null ? void 0 : _a2.length) {
49298
- individualOnfido = {
49299
- ...individualOnfido,
49300
- idVerificationMethod: {
49301
- // Manually set verification method as instantVerification, for existing document journey
49302
- idVerificationMethod: "instantVerification",
49303
- idDocument: mapDocumentDetailToIdDocument(legalEntity.documentDetails)
49304
- }
49305
- };
49306
- }
49307
- if (!(parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations)) {
49308
- return individualOnfido;
49309
- }
49310
- const associations = ((_b2 = parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations) == null ? void 0 : _b2.filter((ea) => ea.legalEntityId === (legalEntity == null ? void 0 : legalEntity.id))) ?? [];
49311
- if (isRoleFieldNeeded && individualOnfido.basicDetails) {
49312
- individualOnfido.basicDetails.role = associations.map((ea) => ea.type);
49313
- individualOnfido.basicDetails.jobTitle = (_c2 = associations.find(
49314
- ({ jobTitle }) => Boolean(jobTitle)
49315
- )) == null ? void 0 : _c2.jobTitle;
49316
- }
49317
- return individualOnfido;
49318
- };
49319
- const mapDocumentDetailToIdDocument = (documents) => {
49320
- var _a2;
49321
- const activeDocument = (_a2 = documents.filter((document2) => document2.active)) == null ? void 0 : _a2[0];
49322
- return activeDocument ? {
49323
- idDocumentType: activeDocument.type,
49324
- modificationDate: activeDocument.modificationDate
49325
- } : void 0;
49326
- };
49327
- const individualOnfidoBaseMapping = {
49328
- "basicDetails.firstName": "individual.name.firstName",
49329
- "basicDetails.lastName": "individual.name.lastName",
49330
- "basicDetails.phoneNumber.number": "individual.phone.number",
49331
- "basicDetails.phoneNumber.phoneCountryCode": "individual.phone.phoneCountryCode",
49332
- "basicDetails.phoneNumber.type": "individual.phone.type",
49333
- "basicDetails.email": "individual.email",
49334
- "additionalPersonalDetails.city": "individual.residentialAddress.city",
49335
- "additionalPersonalDetails.country": "individual.residentialAddress.country",
49336
- "additionalPersonalDetails.postalCode": "individual.residentialAddress.postalCode",
49337
- "additionalPersonalDetails.stateOrProvince": "individual.residentialAddress.stateOrProvince",
49338
- "additionalPersonalDetails.address": "individual.residentialAddress.street",
49339
- "additionalPersonalDetails.otherAddressInformation": "individual.residentialAddress.street2"
49340
- };
49341
- const getIndividualSchemaFromAPI = {
49342
- ...individualOnfidoBaseMapping
49343
- };
49344
- const getAPISchemaFromIndividualSchema = {
49345
- ...reverseObject(individualOnfidoBaseMapping)
49346
- };
49347
49359
  const parseConfiguration$2 = ({ matchingScenario }) => parseIndividualOnfidoScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.INDIVIDUAL]);
49348
49360
  const logger$d = createLogger();
49349
49361
  function IndividualOnfidoDropin({
@@ -49529,7 +49541,7 @@ function IndividualOnfidoDropin({
49529
49541
  individualOnfidoForms,
49530
49542
  (problems == null ? void 0 : problems.remediationActions) ? Object.values(problems == null ? void 0 : problems.remediationActions) : [],
49531
49543
  (problems == null ? void 0 : problems.missingData) ?? [],
49532
- legalEntityResponse ? getFieldsWithExistingData(legalEntityResponse) : [],
49544
+ legalEntityResponse ? getFieldsWithExistingData(legalEntityResponse, true) : [],
49533
49545
  fieldsFromCustomRules,
49534
49546
  {},
49535
49547
  {},
@@ -49663,7 +49675,11 @@ function IndividualOnfidoDropin({
49663
49675
  const onSubmit = async () => {
49664
49676
  var _a3, _b3;
49665
49677
  setLoadingStatus("loading");
49666
- const dataSubmitted = omitObscuredFieldsIfUnchanged([], data, dataFromResponse);
49678
+ const dataSubmitted = omitObscuredFieldsIfUnchanged(
49679
+ individualOnfidoObscuredFields,
49680
+ data,
49681
+ dataFromResponse
49682
+ );
49667
49683
  if (!dataSubmitted) {
49668
49684
  return;
49669
49685
  }
@@ -49716,7 +49732,7 @@ function IndividualOnfidoDropin({
49716
49732
  }
49717
49733
  };
49718
49734
  const canSubmit2 = () => {
49719
- const mandatoryDetails = mandatoryApiFields.INDIVIDUAL;
49735
+ const mandatoryDetails = mandatoryApiFields.INDIVIDUAL_ONFIDO;
49720
49736
  return mandatoryDetails.every((detail) => {
49721
49737
  const value = getProp(data, detail);
49722
49738
  return !isEmpty$1(value) || Array.isArray(detail) && detail.length > 0;
@@ -52811,7 +52827,7 @@ const hasProgressedBeyondEntitySelection = (legalEntity) => {
52811
52827
  return hasOwnEntityAssocation || !!hasOrganizationType;
52812
52828
  };
52813
52829
  const Introduction = lazy$1(
52814
- async () => (await import("./Introduction-CI01rBjT.js")).Introduction
52830
+ async () => (await import("./Introduction-QSBnlZdp.js")).Introduction
52815
52831
  );
52816
52832
  const PAGES_WITH_POLLING = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
52817
52833
  const logger$b = createLogger();
@@ -57705,7 +57721,7 @@ var TanstackQueryDevtools = (_k = class {
57705
57721
  if (__privateGet(this, _Component)) {
57706
57722
  Devtools = __privateGet(this, _Component);
57707
57723
  } else {
57708
- Devtools = lazy(() => import("./CPIOZS5X-n7BNxGnq.js"));
57724
+ Devtools = lazy(() => import("./CPIOZS5X-C5VhSMmP.js"));
57709
57725
  __privateSet(this, _Component, Devtools);
57710
57726
  }
57711
57727
  setupStyleSheet(__privateGet(this, _styleNonce), __privateGet(this, _shadowDOMTarget));
@@ -57827,7 +57843,7 @@ var TanstackQueryDevtoolsPanel = (_l = class {
57827
57843
  if (__privateGet(this, _Component2)) {
57828
57844
  Devtools = __privateGet(this, _Component2);
57829
57845
  } else {
57830
- Devtools = lazy(() => import("./OKF6E45R-CoP-jLEx.js"));
57846
+ Devtools = lazy(() => import("./OKF6E45R-CfDVrj5C.js"));
57831
57847
  __privateSet(this, _Component2, Devtools);
57832
57848
  }
57833
57849
  setupStyleSheet(__privateGet(this, _styleNonce2), __privateGet(this, _shadowDOMTarget2));
@@ -58024,7 +58040,7 @@ const useAnalytics = ({
58024
58040
  onboardingVersion
58025
58041
  }) => {
58026
58042
  const userEvents2 = createUserEvents();
58027
- const sdkVersion = "3.61.0";
58043
+ const sdkVersion = "3.61.1";
58028
58044
  const { isEmbeddedDropin, loadingContext: base } = useAuthContext();
58029
58045
  const rootLegalEntity = useGlobalStore((store) => store.rootLegalEntity);
58030
58046
  const countryCode = useGlobalStore((store) => store.rootLegalEntityCountry);
@@ -58519,7 +58535,7 @@ const ConfigurationApiProvider = ({ children: children2 }) => {
58519
58535
  [authContext, rootLegalEntityId]
58520
58536
  );
58521
58537
  return /* @__PURE__ */ jsxs(ConfigurationApiContext.Provider, { value: contextValue, children: [
58522
- /* @__PURE__ */ jsx$1("span", { className: "adyen-kyc__sdk-version", hidden: true, children: "3.61.0" }),
58538
+ /* @__PURE__ */ jsx$1("span", { className: "adyen-kyc__sdk-version", hidden: true, children: "3.61.1" }),
58523
58539
  children2
58524
58540
  ] });
58525
58541
  };
@@ -58979,7 +58995,7 @@ function StateProvider({
58979
58995
  );
58980
58996
  return /* @__PURE__ */ jsx$1(StateContext.Provider, { value: contextValue, children: children2 });
58981
58997
  }
58982
- const DebugModal = lazy$1(async () => (await import("./DebugModal-BtroLOpK.js").then((n) => n.D)).DebugModal);
58998
+ const DebugModal = lazy$1(async () => (await import("./DebugModal-2qPV3QiR.js").then((n) => n.D)).DebugModal);
58983
58999
  const DebugListener = () => {
58984
59000
  const [debugUiOpen, setDebugUiOpen] = useState(false);
58985
59001
  const { isSettingEnabled } = useSettingsContext();
@@ -1,4 +1,4 @@
1
- import { c as cssProps } from "./DebugModal-BtroLOpK.js";
1
+ import { c as cssProps } from "./DebugModal-2qPV3QiR.js";
2
2
  const definitions = {
3
3
  any: { regex: /.*/g, css: cssProps.text },
4
4
  property: { regex: /(^|[\r\n])[^:]*:/g, css: cssProps.key },
@@ -1,4 +1,4 @@
1
- import { c as cssProps } from "./DebugModal-BtroLOpK.js";
1
+ import { c as cssProps } from "./DebugModal-2qPV3QiR.js";
2
2
  const definitions = {
3
3
  any: { regex: /.*/g, css: cssProps.text },
4
4
  number: { regex: /-?\d+(\.\d+)?([eE][+-]?\d+)?/g, css: cssProps.number },
@@ -1,4 +1,4 @@
1
- import { c as cssProps } from "./DebugModal-BtroLOpK.js";
1
+ import { c as cssProps } from "./DebugModal-2qPV3QiR.js";
2
2
  const definitions = {
3
3
  any: { regex: /.*/g, css: cssProps.text }
4
4
  };
package/dist/style.css CHANGED
@@ -300,7 +300,7 @@
300
300
  box-shadow: var(--adyen-sdk-shadow-high, 0px 18px 36px rgba(0, 17, 44, 0.12), 0px 4px 8px rgba(0, 17, 44, 0.06));
301
301
  overflow: hidden;
302
302
  padding: var(--adyen-sdk-spacer-000, 0px);
303
- position: relative;
303
+ position: fixed;
304
304
  }
305
305
  .adyen-kyc-modal:focus-visible {
306
306
  outline: none;
@@ -1,4 +1,8 @@
1
1
  import type { ExistingLegalEntity, LegalEntity } from '#core/models/api/legal-entity';
2
+ import type { RecursiveKeyOf } from '#utils/getNestedPropertyKeys';
3
+ import type { MappingRecord } from '#utils/mapping/componentApiMapping';
2
4
  import type { IndividualOnfidoSchema } from '../forms/IndividualOnfido/IndividualOnfido.types';
3
5
  export declare const mapIndividualOnfidoSchemaToLegalEntity: (individualOnfido: IndividualOnfidoSchema) => LegalEntity;
4
6
  export declare const mapLegalEntityToIndividualOnfidoSchema: (legalEntity: ExistingLegalEntity, isChangingType?: boolean, isRoleFieldNeeded?: boolean, parentLegalEntity?: ExistingLegalEntity) => IndividualOnfidoSchema;
7
+ export declare const individualOnfidoObscuredFields: Array<RecursiveKeyOf<IndividualOnfidoSchema>>;
8
+ export declare const getAPISchemaFromIndividualSchema: MappingRecord<Pick<LegalEntity, 'individual'>, IndividualOnfidoSchema>;
@@ -1,4 +1,3 @@
1
- import type { ExperimentName } from '#context/ExperimentContext/types';
2
1
  import type { ExistingLegalEntity } from '#core/models/api/legal-entity';
3
2
  import type { BusinessDetailsSchema } from '../components/Business/forms/BusinessDetails/types';
4
3
  import type { CompanySchema } from '../components/Business/forms/Company/types';
@@ -7,4 +6,4 @@ import type { SolePropSchema } from '../components/SoleProprietorship/forms/Sole
7
6
  import type { TrustSchema } from '../components/Trust/forms/Trust/types';
8
7
  import type { RecursiveKeyOf } from './getNestedPropertyKeys';
9
8
  export type AnyTLDSFieldName = RecursiveKeyOf<IndividualSchema> | RecursiveKeyOf<CompanySchema> | RecursiveKeyOf<BusinessDetailsSchema> | RecursiveKeyOf<SolePropSchema> | RecursiveKeyOf<TrustSchema>;
10
- export declare const getFieldsWithExistingData: (legalEntity: ExistingLegalEntity, isExperimentEnabled?: (key: ExperimentName) => boolean) => AnyTLDSFieldName[];
9
+ export declare const getFieldsWithExistingData: (legalEntity: ExistingLegalEntity, newFlow?: boolean) => AnyTLDSFieldName[];
@@ -7,6 +7,7 @@ import type { BusinessDetailsSchema } from '../../components/Business/forms/Busi
7
7
  import type { CompanySchema } from '../../components/Business/forms/Company/types';
8
8
  import type { HighExposureSchema } from '../../components/EFP/tasks/HighExposureDropin/types';
9
9
  import type { IndividualSchema } from '../../components/Individual/forms/Individual/types';
10
+ import type { IndividualOnfidoSchema } from '../../components/Individual/forms/IndividualOnfido/IndividualOnfido.types';
10
11
  import type { SolePropSchema } from '../../components/SoleProprietorship/forms/SoleProp/types';
11
12
  import type { TrustSchema } from '../../components/Trust/forms/Trust/types';
12
13
  import type { AnyTLDSFieldName } from '../getFieldsWithExistingData';
@@ -16,6 +17,7 @@ type DocumentMappingRecord<TargetSchema extends object> = Partial<Record<Documen
16
17
  export type AnyComponentMappingRecord = MappingRecord<IndividualSchema, Pick<LegalEntity, 'individual'>> | MappingRecord<BusinessDetailsSchema, Pick<LegalEntity, 'organization'>> | MappingRecord<CompanySchema, Pick<LegalEntity, 'organization'>> | MappingRecord<SolePropSchema, Pick<LegalEntity, 'soleProprietorship'>> | MappingRecord<TrustSchema, Pick<LegalEntity, 'trust'>>;
17
18
  export declare const mandatoryApiFields: {
18
19
  INDIVIDUAL: Array<Partial<RecursiveKeyOf<IndividualSchema>>>;
20
+ INDIVIDUAL_ONFIDO: Array<Partial<RecursiveKeyOf<IndividualOnfidoSchema>>>;
19
21
  DECISIONMAKER: Array<Partial<RecursiveKeyOf<IndividualSchema>>>;
20
22
  DECISION_MAKER_OWNER: Array<Partial<RecursiveKeyOf<IndividualSchema>>>;
21
23
  ORGANIZATION: Array<Partial<RecursiveKeyOf<CompanySchema>>>;
@@ -2,6 +2,7 @@ import type { ExperimentName } from '#context/ExperimentContext/types';
2
2
  import type { PageType } from '#core/models/api/attachment';
3
3
  import type { Document } from '#core/models/api/document';
4
4
  import type { FinancialReport } from '#core/models/api/financialReport';
5
+ import type { Individual } from '#core/models/api/individual';
5
6
  import type { ExistingLegalEntity, LegalEntity } from '#core/models/api/legal-entity';
6
7
  import type { BusinessLinesType } from '#core/models/api/source-of-funds';
7
8
  import type { ExistingTransferInstrument, TransferInstrument } from '#core/models/api/transfer-instrument';
@@ -12,10 +13,12 @@ import type { PayoutDetailsSchema } from '../../components/BankAccount/forms/Pay
12
13
  import type { CompanySchema } from '../../components/Business/forms/Company/types';
13
14
  import type { HighExposureSchema } from '../../components/EFP/tasks/HighExposureDropin/types';
14
15
  import type { SourceOfFundsSchema } from '../../components/EFP/tasks/SourceOfFundsDropin/types';
16
+ import type { PersonalDetailsSchema } from '../../components/Individual/forms/Individual/PersonalDetails/types';
15
17
  import type { IndividualSchema } from '../../components/Individual/forms/Individual/types';
16
18
  import type { IndividualOnfidoSchema } from '../../components/Individual/forms/IndividualOnfido/IndividualOnfido.types';
17
19
  import type { SolePropSchema } from '../../components/SoleProprietorship/forms/SoleProp/types';
18
20
  import type { TrustSchema } from '../../components/Trust/forms/Trust/types';
21
+ export declare const adjustIdentificationData: (data: Pick<PersonalDetailsSchema, "idNumber" | "idNumberExempt" | "typeOfIdentity">, apiData: Individual["identificationData"]) => Individual["identificationData"];
19
22
  /**
20
23
  * Easy to use function for mapping transferInstrument response to payout account details component data
21
24
  * @param transferInstrument - a transferInstrument the same as found in API response
@@ -1,4 +1,4 @@
1
- import { c as cssProps } from "./DebugModal-BtroLOpK.js";
1
+ import { c as cssProps } from "./DebugModal-2qPV3QiR.js";
2
2
  const definitions = {
3
3
  any: { regex: /.*/g, css: cssProps.text },
4
4
  boolean: { regex: /^(\s*)([\w-]+)(:)\s*(.*)$/g, css: cssProps.boolean },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "3.61.0",
3
+ "version": "3.61.1",
4
4
  "keywords": [
5
5
  "adyen",
6
6
  "adyen-kyc",