UNPKG

@adyen/kyc-components

Version:

This guide assumes that you have already an account with Adyen. A legalEntity needs to be created, and you need to have a `legalEntityId` to instatiate a Component.

81 lines (80 loc) 4.93 kB
try { let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack; n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "338f475c-8d85-43f2-80bf-a36bea50de33", e._sentryDebugIdIdentifier = "sentry-dbid-338f475c-8d85-43f2-80bf-a36bea50de33"); } catch (e) {} import { n as addResourceBundles, r as useTranslation } from "./translation-BYvhW5zA.js"; import { A as _rolldown_dynamic_import_helper_default, _ as isPartOfTrustFromLegalEntity, ft as useAccountHolder } from "./resolveEnvironment-DNmu53Rr.js"; import { r as Loader } from "./Button-i8I2dHP8.js"; import { r as useLegalEntity, t as ROOT_LE } from "./useLegalEntity-CtlUQv_J.js"; import { t as getLegalEntityCountry } from "./getLegalEntityCountry-BHh7Ux8v.js"; import { a as noop } from "./AnalyticsContext-BFrJmsp0.js"; import { C as EntityTypes, c as individualBaseMapping } from "./processCapabilities-fPuXc9gL.js"; import { t as TaskTypes } from "./taskTypes-NawDTp5n.js"; import { n as useCapabilityProblems, t as getProblemsForEntity } from "./getProblemsForEntity-D6XC4DZ2.js"; import { t as filterProblemsByTaskForms } from "./filterProblemsByTaskForms-CQby20PN.js"; import { n as getTrustedFields, r as getTrustedFieldsProvider } from "./getTrustedFields-BJ88GlM-.js"; import { n as individualForms, t as IndividualDropin } from "./IndividualDropin-DHrcFHNx.js"; import { jsx } from "preact/jsx-runtime"; //#region src/components/Individual/pages/RootIndividualDetailsPage.tsx function RootIndividualDetailsPage({ asModal = false, hideSidebar = false, isTargetLegalEntityType = false, onSubmit, handleBackClick, handleCloseClick, handleHomeClick = noop }) { const { data: rootLe } = useLegalEntity(ROOT_LE); const capabilityProblems = useCapabilityProblems(); const { accountHolder } = useAccountHolder(); const { i18n } = useTranslation(); addResourceBundles(i18n, [{ ns: "individual", importFn: (lang) => _rolldown_dynamic_import_helper_default(/* @__PURE__ */ Object.assign({ "../language/bg-BG.json": () => import("./bg-BG-VIyyeYUh.js"), "../language/cs-CZ.json": () => import("./cs-CZ-D8nnXFEh.js"), "../language/da-DK.json": () => import("./da-DK-Cq-1LB6T.js"), "../language/de-DE.json": () => import("./de-DE-Bc55gBv4.js"), "../language/el-GR.json": () => import("./el-GR-Cr-3NgPk.js"), "../language/en-US.instructions.json": () => import("./en-US.instructions-DfgivDPI.js"), "../language/en-US.json": () => import("./en-US-C1J9jcVI.js"), "../language/es-ES.json": () => import("./es-ES-uVSZu-EQ.js"), "../language/es-LA.json": () => import("./es-LA-BU5Op1kh.js"), "../language/et-EE.json": () => import("./et-EE-BFb0MPqf.js"), "../language/fi-FI.json": () => import("./fi-FI-BI9sCCEP.js"), "../language/fr-FR.json": () => import("./fr-FR-_TkFnevF.js"), "../language/hr-HR.json": () => import("./hr-HR-DubR_a2h.js"), "../language/hu-HU.json": () => import("./hu-HU-CK6lbZ-D.js"), "../language/it-IT.json": () => import("./it-IT-CVVOlFfY.js"), "../language/ja-JP.json": () => import("./ja-JP-B8sNFjt_.js"), "../language/lt-LT.json": () => import("./lt-LT-C9lXLzZA.js"), "../language/lv-LV.json": () => import("./lv-LV-2Q8G1u4p.js"), "../language/nl-NL.json": () => import("./nl-NL-DMdoFepr.js"), "../language/no-NO.json": () => import("./no-NO-CwgewQst.js"), "../language/pl-PL.json": () => import("./pl-PL-D-TVYshE.js"), "../language/pt-BR.json": () => import("./pt-BR-DwHag_mp.js"), "../language/pt-PT.json": () => import("./pt-PT-BVcFY8gr.js"), "../language/ro-RO.json": () => import("./ro-RO-D3Yk1KoW.js"), "../language/sk-SK.json": () => import("./sk-SK-D3UYKttr.js"), "../language/sl-SI.json": () => import("./sl-SI-BkcElOhl.js"), "../language/sv-SE.json": () => import("./sv-SE-DkZ2LyW5.js") }), `../language/${lang}.json`, 3) }]); if (!rootLe) return /* @__PURE__ */ jsx(Loader, {}); const country = getLegalEntityCountry(rootLe); const hasTrust = accountHolder === "aTrust" || isPartOfTrustFromLegalEntity(rootLe); const problemsByTask = filterProblemsByTaskForms(capabilityProblems ? getProblemsForEntity(capabilityProblems, EntityTypes.LEGAL_ENTITY, rootLe.id) : void 0, Object.keys(individualForms)); const trustedFieldsProvider = getTrustedFieldsProvider(rootLe); const trustedFields = getTrustedFields(rootLe, individualBaseMapping); return /* @__PURE__ */ jsx(IndividualDropin, { taskType: TaskTypes.INDIVIDUAL, taskName: hasTrust ? "individualTrusteeDetails" : "individualDetails", legalEntityResponse: rootLe, problems: problemsByTask, country, asModal, hideSidebar, isTargetLegalEntityType, onSubmit, trustedFieldsProvider, handleBackClick, handleCloseClick, handleHomeClick, trustedFields }); } //#endregion export { RootIndividualDetailsPage };